Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
W

whitesail

@whitesail
About
Posts
2
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 0x00 byte problem while storing binary data to MySQL BLOB via ODBC (C API)
    W whitesail

    Hi! Thanks, that was helpful, but only partly, since passing SQL_NULL_DATA (-1) instead of 0x00, I get 0xFF value in the base field. if (v[i] == 0x00) v[i] = SQL_NULL_DATA; How do I later distingush real FF bytes from wraped null data? :sigh: Still many thanks for help

    Database database mysql wpf wcf data-structures

  • 0x00 byte problem while storing binary data to MySQL BLOB via ODBC (C API)
    W whitesail

    Have a data truncation problem at NULL byte, while trying to store binary array to BLOB Table 'major' structure is: (smallint) Frame_number|(longblob) ch1|(longblob) ch2|(longblob) ch3|(longblob) ch4|(smallint) frame_size
    Connection to base is done, memory for all necessary handles is allocated. 1. Prepare statemt

    SQLPrepare(sql_hStmt,_T("INSERT INTO major(Frame_number,CH1,CH2,CH3,CH4,frame_size) VALUES(?,?,?,?,?,?)"),SQL_NTS);

    2. Binding params

    SQLBindParameter(sql_hStmt, 1, SQL_PARAM_INPUT, SQL_INTEGER, SQL_INTEGER, 0,0, &frames_parsed, 0, 0);
    SQLBindParameter(sql_hStmt, 2, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_VARBINARY, 0,0, v, bufsz, 0);
    SQLBindParameter(sql_hStmt, 3, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_VARBINARY, 0,0, v, bufsz, 0);
    SQLBindParameter(sql_hStmt, 4, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_VARBINARY, 0,0, v, bufsz, 0);
    SQLBindParameter(sql_hStmt, 5, SQL_PARAM_INPUT, SQL_C_BINARY, SQL_VARBINARY, 0,0, v, bufsz, 0);
    SQLBindParameter(sql_hStmt, 6, SQL_PARAM_INPUT, SQL_INTEGER, SQL_INTEGER, 0,0, &datasize, 0, 0);

    where v - array holding data to be stored to DB. bufsz - its size 3. Cycle execution

    SQLExecute(sql_hStmt);

    Ant suggestion would be great, thanks. ver MySQL - 5.5, ver OBDC - Mysql ODBC 5.1

    Database database mysql wpf wcf data-structures
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups