On Sep 24, 2006, at 6:08 PM, frank van der Zwaag wrote:
Hi All,
I am a bit baffled by the following (MySQL). This application is
based on the Realbasic example which uses the RealDatabase.
Any ideas?
Thanks
Frank
I can open the target MySQL without any problems (I know that as I
can see the connection appear in the MySQL Systems Administrator
window)
(Application open event)
Dim ordersdb as mySQLDatabase
OrdersDB = new mySQLDatabase
OrdersDB.host="127.0.0.1"
OrdersDB.port=3306
OrdersDB.databaseName="kansas"
OrdersDB.userName="frank"
If ordersdb.Connect then
//proceed with database operations
Else
MsgBox "Connection failed!"
DisplayDatabaseError()
end if
Odersdb is LOCAL to the Open event
Then I try to save a customer record in the Main window (Save
button clicked)
// first obtain the last recordno in table customers
dim rs as RecordSet //pointer to recordset
rs = App.OrdersDB.SQLSelect("SELECT MAX(recordno) FROM customers")
-->> At this stage the runtime ends with a nil pointer exception.
Doesn't even make it to the next test.
-->> Tried a rs = new recordset prior to executing the sqlselect
command, but that doesn't do it either.
Yup.
Check that app.ordersdb is NIL
In your open event for the app REMOVE the dim ordersdb as
MYSQLDatabase and make it a PROPERTY of the APPLICATION
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>