When I try to connect to a database named, for example C:\Test\André\DB.db I get the error Library routine called out of sequence. With C:\Test\Andre\DB.db it is fine.
Ken
SQLite3 Connect Error
Moderators: gto, EgonHugeist, olehs
I'm using Delphi 2010. I managed to fix this by changing the code as follows:
function TZSQLiteBaseDriver.Open(const filename: PAnsiChar; mode: Integer;
var errmsg: PAnsiChar): Psqlite;
var
Result0: Psqlite;
Version: string;
FileNameString: String;
begin
// Result0:= nil;
// Version := LibVersion;
// FileNameString := filename;
// if (Version > '3.2.5') then
// SQLite_API.sqlite_open(PAnsiChar(AnsiToUTF8(FileNameString)), Result0)
// else
SQLite_API.sqlite_open(filename, Result0);
Result := Result0;
end;
function TZSQLiteBaseDriver.Open(const filename: PAnsiChar; mode: Integer;
var errmsg: PAnsiChar): Psqlite;
var
Result0: Psqlite;
Version: string;
FileNameString: String;
begin
// Result0:= nil;
// Version := LibVersion;
// FileNameString := filename;
// if (Version > '3.2.5') then
// SQLite_API.sqlite_open(PAnsiChar(AnsiToUTF8(FileNameString)), Result0)
// else
SQLite_API.sqlite_open(filename, Result0);
Result := Result0;
end;
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Does this version work on your system?
That one is safe for all compilers I use and should do exactly what your patch does on D2010, I believe.
Looking at the code in zdbcsqlite.pas and ZPlainSqLiteDriver.pas I think somebody could find a more elegant solution for the 'Open' code. Please, feel free to do suggestions.
Committed this version to SVN testing branch. (rev. 801)
Mark
Code: Select all
function TZSQLiteBaseDriver.Open(const filename: PAnsiChar; mode: Integer;
var errmsg: PAnsiChar): Psqlite;
var
Result0: Psqlite;
{$IFNDEF DELPHI12_UP}
Version: string;
FileNameString: String;
{$ENDIF}
begin
Result0:= nil;
{$IFDEF DELPHI12_UP}
SQLite_API.sqlite_open(filename, Result0);
{$ELSE}
Version := LibVersion;
FileNameString := filename;
if (Version > '3.2.5') then
SQLite_API.sqlite_open(PAnsiChar(AnsiToUTF8(FileNameString)), Result0)
else
SQLite_API.sqlite_open(filename, Result0);
{$ENDIF}
Result := Result0;
end;
Looking at the code in zdbcsqlite.pas and ZPlainSqLiteDriver.pas I think somebody could find a more elegant solution for the 'Open' code. Please, feel free to do suggestions.
Committed this version to SVN testing branch. (rev. 801)
Mark