FMX Desktop application with local SQL database. Database doesn't work properly -


i creating firemonkey desktop application local sqlite database (using delphi xe4 professional), database not work properly. there no probelm, when inserting data database, when trying execute other sql commands on database (especially delete , select), retrieve message "database locked" or "' 7 ' not valid integer value".

in application i've used tsqlconnection, tsqlquery, tdatasetprovider , tclientdataset components connect database. connected existing database in video http://www.youtube.com/watch?v=ljdo0yunvma difference is, database isn't interbase, sqlite.

database created sqlite3.7.11 cmd

create table history (    id  integer       primary key autoincrement,   kod text( 7 ));  create table drogs (    kod    text( 7 )   primary key,   naz    text( 60 ),   dop    text( 60 ),   regcis text( 20 ),   atc    text( 8 ),   hraz   text( 1 ),   obch   text( 1 )); 

after connecting database application (as described above), data inserted table drogs

skod := quotedstr('1234567'); snaz := quotedstr('name'); shraz := quotedstr('0');  sqlquery1.sql.clear; sqlquery1.sql.add('insert drogs (kod, naz, hraz) '); sqlquery1.sql.add('values('+skod+','+snaz+','+shraz+')'); sqlquery1.execsql; 

this works without problems, code

sqlquery1.sql.clear; sqlquery1.sql.add('select * drogs'); sqlquery1.open; 

gives error message

'7 ' not valid integer value 

and code

sqlquery1.sql.clear; sqlquery1.sql.add('delete drogs hraz = "0"'); sqlquery1.execsql; 

"sometimes" gives error message

database locked 

any idea, why happens? i'm out of options...

go sqlquery1 , set "active = false"


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -