Writing binary data to a access database stops working

General discussion forum about all databases other than SqlBase.
thielk

Writing binary data to a access database stops working

Post by thielk » 19 Jun 2013, 19:03

We are porting an application with an access database (*.mdb) from 5.1 to 6.0
So far this works fine.
But we are not able to write binary data into the database anymore.
In 5.1 we did as follwed:

Code: Select all

   
   Call SqlPrepare( l_hSqlRawData, StoreSqlCmd( l_hSqlRawData, '
         insert
         into   raw_data
            ( raw_id,
            raw_data,
            raw_type,
            raw_length,
            raw_length_pack,
            raw_pack )
         values   ( :l_nRawDataID,
            :p_strRawData,
            :p_strRawDataType,
            :p_nRawDataLength,
            :l_nRawDataPackLength,
            :p_bRawDataPack ) ' ) )
   Call SqlSetLongBindDatatype( 2, 23 )
   Call SqlExecute( l_hSqlRawData )
The column raw_data is defined as "OLE-Object".
So far so good.

In V6.0 we get the database error: "Err No: -198708185 :Falscher Datentyp für Parameter ''.; " or in english ""
This is the Access Error Code 3060.
We tried to use the new datatype binary instead of long string and without setting the bind parameter type 23, but we got the same error.
Reading the binary data works fine in both versions with binary and long string datatype.

So can anybody give us a hint or a workaround to solve this problem?

thanks for help
best regards
Thiel

MSchmidt
Germany
Posts: 299
Joined: 03 Jul 2017, 09:28
Location: Germany

Re: Writing binary data to a access database stops working

Post by MSchmidt » 20 Jun 2013, 08:37

only a try

Maybe you can separate the SQl in 2 parts

1. part: Insert without raw_data
2. part: update with raw-data

or
place the raw_data column at the end of the insert statement
(there are some issues like this one described in the forum )


as writen: it's a try

kind regards
M.Schmidt

thielk

Re: Writing binary data to a access database stops working

Post by thielk » 24 Jun 2013, 09:41

it's a very good TRY!

placing the binary value at the end of the insert statement solves the problem.
Now it works fine.

Thanks for the hint!

best regards
Thiel

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests