Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. QT 中为什么读取 sqlite 的 blob 字段内容和实际数据库中得内容不一样
Forum Updated to NodeBB v4.3 + New Features

QT 中为什么读取 sqlite 的 blob 字段内容和实际数据库中得内容不一样

Scheduled Pinned Locked Moved Chinese
2 Posts 1 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    smallghost
    wrote on last edited by
    #1

    代码其实很简单:
    QSqlQuery query(db);
    query.exec("select blobfield from img");
    query.first();
    QByteArray bytes = query.record().value(0).toByteArray();
    这里得到的bytes数据 和 用数据库工具中看到的内容不一样。我用delphi把数据导出来看和数据库工具看得一模一样的,是不是还有什么选项需要设置呢?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      smallghost
      wrote on last edited by
      #2

      是在win7 64-bit的系统上发现这个问题的,搞了一天都没有找到是啥原因!求高手指点!

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved