MySQL Forums
Forum List  »  Connector/ODBC

incorrect string value
Posted by: Артём Будейкин
Date: January 12, 2021 07:58AM

I work in Rad studio 10.4, using ODBC 8.0 UNICODE Driver.
I am trying to insert blob data into table with column type LONGBLOB from memory stream in c++ code. I have correct connection, cause i can read and insert data from other tables. My connection string (some fields from form):

TestConnectionString = "Provider=MSDASQL.1;Driver={MySQL ODBC 8.0 UNICODE Driver};" "Server=" + TestServerName + ";Database=" + TestDatabaseName + ";User=" + TestUserName + ";Password=" + TestUserPassword + ";Charset=utf8mb4;Option=3;";

I checked all char sets and all seems to be correct:

'character_set_client', 'utf8mb4'
'character_set_connection', 'utf8mb4'
'character_set_database', 'utf8mb4'
'character_set_filesystem', 'binary'
'character_set_results', 'utf8mb4'
'character_set_server', 'utf8mb4'
'character_set_system', 'utf8'
'collation_connection', 'utf8mb4_unicode_ci'
'collation_database', 'utf8mb4_unicode_ci'
'collation_server', 'utf8mb4_unicode_ci'

But then i try to insert blob to one table, i have an error
Code:
ADOCommand->Parameters->ParamByName(FieldName)->LoadFromStream(CurvesSrotageItem->ExtraCurves.at(i).ms, ftBlob);
ADOCommand->Execute();
while (ADOCommand->States == TObjectStates() << stExecuting)
Sleep(100);

error:
[MySQL][ODBC 8.0(w) Driver][mysqld-8.0.22]Incorrect string value: '\xA0\xA4@]\x00\x00...' for column 'Diagram' at row 1

I have exactly the same code for another table (tables fully identical) and it works fine. What's the problem? What else i need to do?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.