Hello,I want to store image into MS access database,but always error echo in "invoke SQLExecute,hStmt" line,Can smartperson tell me why and how to do?

invoke filesize,SADD("sttup.bmp")
mov _FileSize,eax
invoke ReadFileToBuff,SADD("sttup.bmp"),addr BMPbuff

invoke SQLAllocHandle, SQL_HANDLE_STMT, hConn, addr hStmt
invoke SQLPrepare,hStmt,SADD("insert into main (ID,bmp) values (?,?)"),SQL_NTS
invoke StrLen,addr IDbuff
mov _Len,eax
invoke SQLBindParameter,hStmt,1,SQL_PARAM_INPUT,SQL_C_CHAR,SQL_CHAR,16,0,addr IDbuff,_Len,addr _Len
invoke SQLBindParameter,hStmt,2,SQL_PARAM_INPUT,SQL_C_BINARY,SQL_LONGVARBINARY,sizeof BMPbuff,0,addr BMPbuff,_FileSize,addr _FileSize

invoke SQLExecute,hStmt

Posted on 2003-10-10 22:41:02 by wang_xianmin
Is it BLOB field? As far as I remember bitmaps in MS Access databases would also come with an OLE header (78 byte header afaik).
Posted on 2003-10-10 23:26:46 by comrade
Not sure it HAS to have an OLE header, it is most likely something Access puts in to know what that data is. As far as I know you can store anything you like in BLOB, even Access uses it to store BASIC byte code and form data in MSysModules and those other hidden tables.
Posted on 2003-10-11 21:08:29 by comrade