In my test application I’m connecting to an Access database via the GetOpenFolderItem function but quite regularly in testing I’m forgetting to connect to the database and then errors are thrown upon my first call to any recordsets. Yes, I could run the GetOpenFolderItem function first thing automatically but I’d rather test if there is a connection to start with.
I’m not sure I’m following. You are not connected unless you call ODBCDatabase.Connect. There won’t be any connection to start with unless you do that first.
I want to know if there is a way to check if my ODBCDatabase variable “db” has been dimensioned or assigned.
I’m primarily concentrating on my SQL components at the moment, haven’t yet written any preference file type routines in order to record the last directory path and database filename information. This will be the approach to connecting to a database when done.
If it can’t be done, checking if a variable hasn’t been assigned then I’ll simply hardcode the directory path and database filename and connect that way until I get to working on my preference setup routine.