From f27787b2690c5d56b35bc6b1ababce53749a037b Mon Sep 17 00:00:00 2001 From: ondrej Date: Thu, 19 Dec 2019 16:54:36 +0000 Subject: [PATCH] sqldb: odbc: send SQL to ODBC as WideString to support FPC 3.0.x character conversion git-svn-id: trunk@43699 - --- packages/fcl-db/src/sqldb/odbc/odbcconn.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/fcl-db/src/sqldb/odbc/odbcconn.pas b/packages/fcl-db/src/sqldb/odbc/odbcconn.pas index 0cd2737c03..ea48581966 100644 --- a/packages/fcl-db/src/sqldb/odbc/odbcconn.pas +++ b/packages/fcl-db/src/sqldb/odbc/odbcconn.pas @@ -735,6 +735,7 @@ end; procedure TODBCConnection.PrepareStatement(cursor: TSQLCursor; ATransaction: TSQLTransaction; buf: string; AParams: TParams); var ODBCCursor:TODBCCursor; + wbuf: widestring; begin ODBCCursor:=cursor as TODBCCursor; @@ -761,8 +762,9 @@ begin ODBCCursor.FQuery:=Buf; if not (ODBCCursor.FSchemaType in [stTables, stSysTables, stColumns, stProcedures, stIndexes]) then begin + wbuf := buf; ODBCCheckResult( - SQLPrepare(ODBCCursor.FSTMTHandle, PChar(buf), Length(buf)), + SQLPrepareW(ODBCCursor.FSTMTHandle, PWideChar(wbuf), Length(wbuf)), SQL_HANDLE_STMT, ODBCCursor.FSTMTHandle, 'Could not prepare statement.' ); end;