mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 16:10:07 +02:00
* fixes some sqlite bugs
git-svn-id: trunk@3454 -
This commit is contained in:
parent
b87109913c
commit
47c93d1e79
@ -323,7 +323,7 @@ end;
|
|||||||
function TSQLite.Query(Sql: String; Table: TStrings ): boolean;
|
function TSQLite.Query(Sql: String; Table: TStrings ): boolean;
|
||||||
//var
|
//var
|
||||||
// fPMsg: PChar;
|
// fPMsg: PChar;
|
||||||
var Psql : pchar;
|
//var Psql : pchar;
|
||||||
begin
|
begin
|
||||||
fError := SQLITE_ERROR;
|
fError := SQLITE_ERROR;
|
||||||
if fIsOpen then
|
if fIsOpen then
|
||||||
@ -333,13 +333,10 @@ begin
|
|||||||
fTable := Table;
|
fTable := Table;
|
||||||
if fTable <> nil then
|
if fTable <> nil then
|
||||||
fTable.Clear;
|
fTable.Clear;
|
||||||
Psql:=StrAlloc (length(Sql)+1);
|
|
||||||
strpcopy(Psql,Sql);
|
|
||||||
List_FieldName.clear;
|
List_FieldName.clear;
|
||||||
List_Field.clear;
|
List_Field.clear;
|
||||||
Nb_Champ:=-1;
|
Nb_Champ:=-1;
|
||||||
fError := SQLite_Exec(fSQLite, Psql, @ExecCallback, Self, @fPMsg);
|
fError := SQLite_Exec(fSQLite, PChar(sql), @ExecCallback, Self, @fPMsg);
|
||||||
strdispose(Psql);
|
|
||||||
SQLite_FreeMem(fPMsg);
|
SQLite_FreeMem(fPMsg);
|
||||||
fChangeCount := SQLite_Changes(fSQLite);
|
fChangeCount := SQLite_Changes(fSQLite);
|
||||||
fTable := nil;
|
fTable := nil;
|
||||||
@ -348,7 +345,7 @@ begin
|
|||||||
fOnQueryComplete(Self);
|
fOnQueryComplete(Self);
|
||||||
end;
|
end;
|
||||||
fMsg := ErrorMessage(fError);
|
fMsg := ErrorMessage(fError);
|
||||||
Result := (fError <> SQLITE_OK);
|
Result := (fError = SQLITE_OK);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSQLite.Cancel: boolean;
|
function TSQLite.Cancel: boolean;
|
||||||
@ -385,7 +382,6 @@ end;
|
|||||||
|
|
||||||
function TSQLite.ErrorMessage(ErrNo: Integer): string;
|
function TSQLite.ErrorMessage(ErrNo: Integer): string;
|
||||||
begin
|
begin
|
||||||
exit;
|
|
||||||
if ErrNo = 0 then
|
if ErrNo = 0 then
|
||||||
Result := MsgNoError
|
Result := MsgNoError
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user