sqlite - Zeoslib won't allow switching database? -
i utilize zeoslib components interact sqlite database file. have several sqlite database files in folder. so, want able open 1 of them using zeoslib component. however, won't allow me. opens first database database file open after that, access violation error. life of me, can't figure out why.
here how open database file.
class="lang-pascal prettyprint-override">procedure tmainfrm.open1click(sender: tobject); var currdb:string; begin opendlg.initialdir := basedir; if opendlg.execute = true begin currdb := extractfilename(opendlg.filename); datamodule1.zconnection1.disconnect; datamodule1.zconnection1.protocol := 'sqlite-3'; datamodule1.zconnection1.database :=basedir + currdb; datamodule1.query1.sql.clear; datamodule1.query1.sql.add('select * mytable'); // <<<<--- zconnection1 query1 database connection. datamodule1.zconnection1.connect; // <<<<<-------here access violation time. updategrid; // <<<<<<<----- here query executed , dbgrid updated. end; end;
i don't know why is. mean can't switch database using zeoslib component?
the problem in tzconnection.protocol
value capitalization. alter protocol
value sqlite-3
sqlite-3
.
database sqlite delphi access-violation zeos
No comments:
Post a Comment