I am trying to convert my code to ADO from DAO, but I am getting errors...below is bit of my code have converted to ADO, but I am getting this error:
Any idea what is wrong with the code below??
Cheers
Will
Run-time error '91':
Object variable or With block variable not set
Any idea what is wrong with the code below??
Cheers
Will
Code:
Dim cnn As ADODB.Connection
Dim rsDBStatus As ADODB.Recordset
Dim strDBStatus As String
Set cnn = CurrentProject.Connection
'Get the current db status (locked or unlocked)
rsDBStatus.Open "SELECT * FROM tblCfg WHERE Cfg_Name=""Locked""", cnn
strDBStatus = rsDBStatus("Cfg_Value")
MsgBox strDBStatus
rsDBStatus.Close
cnn.Close