A typecast is needed in TZInterbase6Connection.CreateNewDatabase to convert the SQL parameter to an AnsiString. The sc_dsql_execute_immediate call expects and PAnsiChar and is getting a pointer to the UnicodeString (see modified version below).
procedure TZInterbase6Connection.CreateNewDatabase(const SQL: String);
var
DbHandle: PISC_DB_HANDLE;
TrHandle: PISC_TR_HANDLE;
begin
Close;
DbHandle := nil;
TrHandle := nil;
FPlainDriver.isc_dsql_execute_immediate(@FStatusVector, @DbHandle, @TrHandle,
0, PAnsiChar(AnsiString(sql)), FDialect, nil); <-- This line
CheckInterbase6Error(FPlainDriver, FStatusVector, lcExecute, SQL);
FPlainDriver.isc_detach_database(@FStatusVector, @DbHandle);
CheckInterbase6Error(FPlainDriver, FStatusVector, lcExecute, SQL);
end;
[patch_done] Interbase bug w/createNewDatabase in D2009
Moderators: gto, EgonHugeist, olehs
-
- Zeos Dev Team
- Posts: 13
- Joined: 04.02.2006, 05:34
- Location: Virginia
- Contact:
Thank you David. This is the solution of this thread:
http://zeos.firmos.at/viewtopic.php?t=1680
http://zeos.firmos.at/viewtopic.php?t=1680