I just finished building a functional database program and was about to submit it. The startup is sub_main() which connects to access database, as follows
The connection is created and works fine. At first my application was using MDI FORM based where everything was in the MDI Form thru buttons. But now, they wanted a "Switch Board Form" so sub_main() opens frmswitch which got 10 buttons for each form.
Now, the problem is when a button is clicked to open a form and that opened form have to get something from the database as it opens up [at form_load], like this:
it generates error because connectionstrin g of db variable becomes null. I don't know when the error emerges because sometimes it works fine, sometimes it doesn't.
I never had the problem in the previous application, just when the whole Switch Board application request came in.
Why would db.connectionst ring became null or blank?
[/code]
Code:
'public variable public db as new adodb.connection sub main() 'create connection end sub
Now, the problem is when a button is clicked to open a form and that opened form have to get something from the database as it opens up [at form_load], like this:
Code:
dim rs1 as new adodb.recordset rs1.open sql,db,adopenkeyset,adlockoptimistic
I never had the problem in the previous application, just when the whole Switch Board application request came in.
Why would db.connectionst ring became null or blank?
[/code]