mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 21:49:18 +02:00
fcl-db: sqlite: implement CreateDB/DropDB methods + InitializeSqlite/ReleaseSqlite
git-svn-id: trunk@30885 -
This commit is contained in:
parent
126f94ba41
commit
5b3b1c7dea
@ -980,7 +980,7 @@ function TSQLite3Connection.GetConnectionInfo(InfoType: TConnInfoType): string;
|
|||||||
begin
|
begin
|
||||||
Result:='';
|
Result:='';
|
||||||
try
|
try
|
||||||
InitializeSqlite(SQLiteDefaultLibrary);
|
InitializeSqlite;
|
||||||
case InfoType of
|
case InfoType of
|
||||||
citServerType:
|
citServerType:
|
||||||
Result:=TSQLite3ConnectionDef.TypeName;
|
Result:=TSQLite3ConnectionDef.TypeName;
|
||||||
@ -1003,13 +1003,18 @@ procedure TSQLite3Connection.CreateDB;
|
|||||||
var filename: ansistring;
|
var filename: ansistring;
|
||||||
begin
|
begin
|
||||||
CheckDisConnected;
|
CheckDisConnected;
|
||||||
filename := DatabaseName;
|
|
||||||
try
|
try
|
||||||
|
InitializeSqlite;
|
||||||
|
try
|
||||||
|
filename := DatabaseName;
|
||||||
checkerror(sqlite3_open(PAnsiChar(filename),@fhandle));
|
checkerror(sqlite3_open(PAnsiChar(filename),@fhandle));
|
||||||
finally
|
finally
|
||||||
sqlite3_close(fhandle);
|
sqlite3_close(fhandle);
|
||||||
fhandle := nil;
|
fhandle := nil;
|
||||||
end;
|
end;
|
||||||
|
finally
|
||||||
|
ReleaseSqlite;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSQLite3Connection.DropDB;
|
procedure TSQLite3Connection.DropDB;
|
||||||
|
Loading…
Reference in New Issue
Block a user