[patch_done] Interbase bug w/createNewDatabase in D2009

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
DavidVTaylor
Zeos Dev Team
Zeos Dev Team
Posts: 13
Joined: 04.02.2006, 05:34
Location: Virginia
Contact:

[patch_done] Interbase bug w/createNewDatabase in D2009

Post by DavidVTaylor »

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;
mariuszekpl
Senior Boarder
Senior Boarder
Posts: 54
Joined: 30.09.2008, 10:59

Post by mariuszekpl »

Thx ;)
SlavoF
Junior Boarder
Junior Boarder
Posts: 29
Joined: 12.02.2009, 15:31
Location: Nitra, Slovakia
Contact:

Post by SlavoF »

Thank you David. This is the solution of this thread:
http://zeos.firmos.at/viewtopic.php?t=1680
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

SVN rev. 603
Locked