Recent

Author Topic: Sqlite3 Operation can't performed on inactive data set  (Read 8248 times)

BlueIcaro

  • Hero Member
  • *****
  • Posts: 831
    • Blog personal
Sqlite3 Operation can't performed on inactive data set
« on: October 27, 2010, 11:18:13 am »
Hello, I have app with many sqlite tables, one of those have three lookup three.  When I start my app it's works nice. Then I add some dato to this database, using a form with some datalookup components, and it's works.

I close the app, my app on close events, close the the database. Then when I run again my app. show the error. Also if I try to open the database using the sqlite component I got the same error.

Only I can do, is create the table again, using the component, but I lost the data stored.

What happen?

I use lazarus 0.9.29 svn: 27806 adn fpc: 2.4.3

Thanks

/Jorge

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: Sqlite3 Operation can't performed on inactive data set
« Reply #1 on: October 28, 2010, 03:39:11 am »
One possible solution is to use the sqldb components but do not initialize in the properties, instead?, do a manual coding, calling it from form_load.
eq.
SQLConnection1.Databasename := 'xxxx';
SQLTransaction1.Connection := SQLConnection1;
SQLQuery1.Connection := SQLConnection1;
Datasource1.Dataset := SQLQuery1;
DBGrid1.Datasource := Datasource1;

BlueIcaro

  • Hero Member
  • *****
  • Posts: 831
    • Blog personal
Re: Sqlite3 Operation can't performed on inactive data set
« Reply #2 on: October 28, 2010, 07:48:06 am »
Hello, I use sqlite3dataset and a DataSource. I don't use Sqlconnection. But I going to change the application to use SqlConnection, so xenablaise I'll ask in this post, if I have any problem.

I hope I can have your help xenablaise.

/BLueIcaro

BlueIcaro

  • Hero Member
  • *****
  • Posts: 831
    • Blog personal
Re: Sqlite3 Operation can't performed on inactive data set
« Reply #3 on: October 28, 2010, 09:33:29 am »
I did some test. If I delete de field in object inspector I can open the database.

/BlueIcaro

BlueIcaro

  • Hero Member
  • *****
  • Posts: 831
    • Blog personal
Re: Sqlite3 Operation can't performed on inactive data set
« Reply #4 on: October 28, 2010, 10:09:13 am »
I use sqlite3dataset, and SqlQuery, and when I do the sql order:
Select * from tbTrabajos;

I got a error: ID unkonw type fo fied

I create ID field is autoinc

Any help?

/BlueIcaro

P.D: Used:  create table tbclientes (id 'autoinc' nombre varchar(30));
« Last Edit: October 28, 2010, 10:15:23 am by BlueIcaro »

xenblaise

  • Sr. Member
  • ****
  • Posts: 358
Re: Sqlite3 Operation can't performed on inactive data set
« Reply #5 on: October 28, 2010, 10:39:37 am »
Quote
I use sqlite3dataset, and SqlQuery,

why used 2 datasets, sqlquery is a decendant of a dataset too.
so your using 2 datasets in the same connection?

Have you visit to this link, try to find anything if it can help you, this is also a sqlite connection.

http://wiki.lazarus.freepascal.org/User:Rocarobin

look at the way I build my code, maybe you could find it. :D

 

TinyPortal © 2005-2018