Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Issue with getting data back from a sqlite3 database
Issue with getting data back from a sqlite3 database [message #19644] Sat, 27 December 2008 13:48 Go to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Hi all,

I wrote the following code which works when oepning and closing the sqllite3 database file :

if(deepSkySession.Open("deepSkyDB")){
deepMessageLbl.SetText("En consultation");
Sql sql(deepSkySession);
sql.Clear();


sql.Execute("select * from deepskygendata");

PromptOK(AsString(sql.GetColumns()));
}
else PromptOK("Impossible d'ouvrir la base de données");
}


but I did not recover data information as sql.getcolumns() returned 0.

I have built my database using Sqliteman software and when I built the query through Sqliteman I got the following syntax :

SELECT CONSNAME FROM "main"."deepskygendata";

How can I write the sql.execute(String str)so it goes right ?

Thanks in advance for help

Regards
Biobytes
Re: Issue with getting data back from a sqlite3 database [message #19647 is a reply to message #19644] Sat, 27 December 2008 23:42 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
You have to call sql.Fetch() first, I think.

BTW, why don't you use Upp way to handle your database?
Re: Issue with getting data back from a sqlite3 database [message #19648 is a reply to message #19647] Sun, 28 December 2008 09:22 Go to previous messageGo to next message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Thank you for your advice,

I still got an error "assertion failed : NULL != stmt". I think the syntax of my sql query is not correct. When I check if the base is open, I get true response as well as false when I close the sqlite file "DeepSkyDB".

Please what do you mean by UPP way ? I am a newbie for connecting databases with UPP.

Thanks for your reply

Kind regards
Biobytes
Re: Issue with getting data back from a sqlite3 database [message #19649 is a reply to message #19648] Sun, 28 December 2008 10:49 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 693
Registered: December 2005
Location: Budapest, Hungary
Contributor
Read "SQL programming" chapter here and check the sql examples in "reference" assembly.
Re: Issue with getting data back from a sqlite3 database [message #19650 is a reply to message #19649] Sun, 28 December 2008 18:24 Go to previous message
BioBytes is currently offline  BioBytes
Messages: 307
Registered: October 2008
Location: France
Senior Member
Thanks,

I will try to use this information

Regards
Biobytes
Previous Topic: Convert String to SqlId
Next Topic: How to use Sql * Update
Goto Forum:
  


Current Time: Thu Mar 28 11:29:23 CET 2024

Total time taken to generate the page: 0.02300 seconds