Hello together,
does anybody know how to use SQLite Methods from the SQlite Object Reference in B4P??
Especially the AExcute method is very helpfull to do insertions. No Apostrophs, Chr(34) .... -constucts are needed, you put your Values into an array and insert it to the table.
In NSBasic it is used in this way:
arr(0) = UrAktTab 'IDStr
arr(1) = NewFi 'TNam
arr(2) = UrSpAnz 'HGroesse
arr(3) = FiAusdruck 'HVeraendert
arr(4) = CStr(SpAnz)
arr(5) = CNa
arr(6) = ColW
sqlins = "INSERT INTO [SysDBObs] VALUES (?,?,?,?,?,?)"
db.Execute ("BEGIN TRANSACTION")
db.AExecute sqlins, arr
db.Execute ("COMMIT TRANSACTION")
If db.lastError <> "" Then
MsgBox "Error occured: " & db.lastError
db.lastError = ""
End If
LastError is also usefull, but I don't know how to use.
Best regards
berndgoedecke
does anybody know how to use SQLite Methods from the SQlite Object Reference in B4P??
Especially the AExcute method is very helpfull to do insertions. No Apostrophs, Chr(34) .... -constucts are needed, you put your Values into an array and insert it to the table.
In NSBasic it is used in this way:
arr(0) = UrAktTab 'IDStr
arr(1) = NewFi 'TNam
arr(2) = UrSpAnz 'HGroesse
arr(3) = FiAusdruck 'HVeraendert
arr(4) = CStr(SpAnz)
arr(5) = CNa
arr(6) = ColW
sqlins = "INSERT INTO [SysDBObs] VALUES (?,?,?,?,?,?)"
db.Execute ("BEGIN TRANSACTION")
db.AExecute sqlins, arr
db.Execute ("COMMIT TRANSACTION")
If db.lastError <> "" Then
MsgBox "Error occured: " & db.lastError
db.lastError = ""
End If
LastError is also usefull, but I don't know how to use.
Best regards
berndgoedecke