Hi Guys,
I finally jumped from VB6 to RealStudio a year ago and then to Xojo when it was released. I am finding out that 25 years of VB has not done much for my programming skills except make me depend on VB to clean up my bad habits. I am attempting to set up communications with a pre-existing database using a small program to demonstrate that I can read and write to the sqllite database engine provided by Xojo. I have a method placed in a module that connects a global variable called 'DB' with a database. It can be called by using a method called SetDB the database name is passed using a variable called DBname as a string. Below is the offending snippet;
Sub SetDB(dbname as string)
msgbox dbname
db.DatabaseName=dbname
if db.Connect=false then
msgbox "couldnt connect with the database"
quit
end if
End Sub
Everytime the program hits db.DatabaseName=str(dbname) the program halts with a NilObjectException. I test to see of the DBname is being passed correctly by using a message box and all is well until it hits the db.DatabaseName=dbname line.
The calling piece of code is SetDB "testdb.sqllite", The program attempts to execute the method and passes the name of the database, but for the life of me, I cant figure out why this exception is being raised.
I dont want to put my Mac on ebay with "serious hammer damage", but If I cant solve what seems to be a most basic problem, then it will get nasty.
Any help will be most appreciated.
Chris