PDA

View Full Version : Need help with error in yearbook project


perry_d76
04-21-2004, 11:36 AM
I am getting an error in my project and I don't know what it is. I am posting the file and when you run it I get a debug error in the SQL logic. If someone can help me out here I would greatly appreciate it. I am posting the file right now.


TRACE: Main -> On Show
TRACE: 0: local this="Main";
TRACE: 2: db=SQLite.Open("Autoplay\\Docs\\yearbook.db");
TRACE: LastError = 0 ("Success.")
TRACE: 5: SQLite.Query(db, "Create table Students(RecID integer primary key, ID text, LastName text, FirstName text, Semester text, ClassStanding text, Major text, Minor text, HomeTown text, State text, ImagePath text)");

here is the error when you run it:
TRACE: LastError = 30001 ("SQL logic error or missing database")

TRACE: 8: tblRecordSet = SQLite.QueryToTable(db, "Select * from Students;");
TRACE: LastError = 0 ("Success.")
TRACE: 10: if tblRecordSet.Rows == 0 then
TRACE: 40: SQLite.Close(db)
TRACE: LastError = 0 ("Success.")

Thanks in advance to anyone that can help,
Jason

Worm
04-21-2004, 11:50 AM
The error that is reported is due to the fact that there is already a table in the database named Students. Executing Create Table for a table that already exists should generate an error.

I purposely put that there so that if the database wasn't found, it would create it, the table and enter the sample data.

If you already have the database and data, you don't need to even have that statement in your project.

I am getting an error in my project and I don't know what it is. I am posting the file and when you run it I get a debug error in the SQL logic. If someone can help me out here I would greatly appreciate it. I am posting the file right now.


TRACE: Main -> On Show
TRACE: 0: local this="Main";
TRACE: 2: db=SQLite.Open("Autoplay\\Docs\\yearbook.db");
TRACE: LastError = 0 ("Success.")
TRACE: 5: SQLite.Query(db, "Create table Students(RecID integer primary key, ID text, LastName text, FirstName text, Semester text, ClassStanding text, Major text, Minor text, HomeTown text, State text, ImagePath text)");

here is the error when you run it:
TRACE: LastError = 30001 ("SQL logic error or missing database")

TRACE: 8: tblRecordSet = SQLite.QueryToTable(db, "Select * from Students;");
TRACE: LastError = 0 ("Success.")
TRACE: 10: if tblRecordSet.Rows == 0 then
TRACE: 40: SQLite.Close(db)
TRACE: LastError = 0 ("Success.")

Thanks in advance to anyone that can help,
Jason

perry_d76
04-21-2004, 11:59 AM
ok I see what you mean