Posted: Fri Mar 28, 2003 11:43 pm
Restored from previous forum. Originally posted by effigy.
Below is an example of where I'm having a problem. (I think I'm just using the odbc open and init functions wrong)
If InitDatabase()
If OpenDatabase(21, "cal", "", "")
Else
MessageRequester("Alert","Database could not be opened!",#PB_MessageRequester_Ok )
EndIf
Else
MessageRequester("Alert","ODBC could not be initialized!",#PB_MessageRequester_Ok )
EndIf
Procedure getcalinfo(begindate, enddate)
dbquery.s="select * from schedule"
If DatabaseQuery("select * from schedule")
NextDatabaseRow()
MessageRequester("Alert","Data Received",#PB_MessageRequester_Ok )
Else
MessageRequester("Alert","DB Query Failed or empty",#PB_MessageRequester_Ok )
EndIf
EndProcedure
Dim test(100)
getcalinfo(Date(2003,03,26,09,30,00),Date(2003,03,26,10,30,00))
My problem is... this code wont make the connection... the Query Failed message comes up.
However if I remove the Dim command then the query works????
Do I have to init the connection everytime I start a query, or only once?
Thanks
Derek
Below is an example of where I'm having a problem. (I think I'm just using the odbc open and init functions wrong)
If InitDatabase()
If OpenDatabase(21, "cal", "", "")
Else
MessageRequester("Alert","Database could not be opened!",#PB_MessageRequester_Ok )
EndIf
Else
MessageRequester("Alert","ODBC could not be initialized!",#PB_MessageRequester_Ok )
EndIf
Procedure getcalinfo(begindate, enddate)
dbquery.s="select * from schedule"
If DatabaseQuery("select * from schedule")
NextDatabaseRow()
MessageRequester("Alert","Data Received",#PB_MessageRequester_Ok )
Else
MessageRequester("Alert","DB Query Failed or empty",#PB_MessageRequester_Ok )
EndIf
EndProcedure
Dim test(100)
getcalinfo(Date(2003,03,26,09,30,00),Date(2003,03,26,10,30,00))
My problem is... this code wont make the connection... the Query Failed message comes up.
However if I remove the Dim command then the query works????
Do I have to init the connection everytime I start a query, or only once?
Thanks
Derek