Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3666

Lots to learn, missing a step somewhere with sqlite

$
0
0

Ok, old time (also old) coder here, I am trying to convert a application written by me in Vb.net, actually first written in Fortran on a VaxVMS using RDB database, that is how old I am at this. So not new to coding and having an issue just starting out with Xojo. I have converted my Oracle database to sqlite and I am trying to create a web app on Mac OS. I have it opening the database, using build copy files I move it and now no longer getting an error at runtime about db not found. But in main window, all I have right now is one text field, I just want to execute a super simple SQL statement and get a item from a record, really don’t care what, I just want to confirm database is really open in main window. My SQL statement is just Select item_shortname from item, can’t get any simpler. I keep failing on the if not db.connect statement so it’s obvious the variable DB that was set in the session opening method is not global. Do I need to declare it in a module for it to be global ? do I need to re-open the database every time I want to execute a SQL statement ? I do have the actual open db code in a session method called from session opening.

I needed a property to get things going that I was missing but still not working. Here is my code

dim sql as string
sql = “Select item_shortname from item”

Try
DB.ExecuteSQL(sql)
Catch error As DatabaseException
MessageBox("DB Error: " + error.Message)
End Try

I fail on the DB command, it’s a nil object, I still want to put the one variable I return into text field nametest but nametest.text is not my issue yet.

this is super basic at this point and I seem to be stuck, but just wait until I start asking how to convert my windows DLL’s to Mac with Xojo, I know there is no concept of DLLs, so I think I have put all the subs and functions into a module, but first lets get it connected to database.

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 3666

Trending Articles