A
Alex
I have an issue with the different recordsets from the same DB. I'm trying to
establish one connection and open and close one recordset and after that to
open and close another recordset. On my computer everything is working very
well. However, on another computer the only first recordset is working.
Dim Cnxn As ADODB.Connection
Dim rstData As ADODB.Recordset
Set Cnxn = New ADODB.Connection
strCnxn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=...;"
Cnxn.Open strCnxn
Set rstData = New ADODB.Recordset
rstData.Open "SELECT ...", Cnxn, adOpenStatic
Worksheets(CodeSheet).Range("A2").CopyFromRecordset rstData
rstData.Close
Set rstData = Nothing
' *** This recordset is not working on another computer but working very
well on mine******
Set rstData = New ADODB.Recordset
rstData.Open "SELECT dbo_Product.[Product_ID] AS NotDisc" _
& " FROM dbo_Product" _
& " WHERE (dbo_Product.[Product_ID] = '" & Code & "' AND
dbo_Product.[Discontinued]= 0)", Cnxn, adOpenKeyset
rstNum = rstData.RecordCount
rstData.Close
Set rstData = Nothing
Another similar thing that isn't working on another computer but working on
mine is:
I have a form (the same app) and I'm establishing the connection on the form
opening and close it with the form unloading.The recordset isn't working
there. The connection name is the same Cnxn. I've tried to give different
names to the connections and recordsets but it doesn't help.
Please, advise what can be wrong with all this stuff.
Thanks
establish one connection and open and close one recordset and after that to
open and close another recordset. On my computer everything is working very
well. However, on another computer the only first recordset is working.
Dim Cnxn As ADODB.Connection
Dim rstData As ADODB.Recordset
Set Cnxn = New ADODB.Connection
strCnxn = "Driver={Microsoft Access Driver (*.mdb)};Dbq=...;"
Cnxn.Open strCnxn
Set rstData = New ADODB.Recordset
rstData.Open "SELECT ...", Cnxn, adOpenStatic
Worksheets(CodeSheet).Range("A2").CopyFromRecordset rstData
rstData.Close
Set rstData = Nothing
' *** This recordset is not working on another computer but working very
well on mine******
Set rstData = New ADODB.Recordset
rstData.Open "SELECT dbo_Product.[Product_ID] AS NotDisc" _
& " FROM dbo_Product" _
& " WHERE (dbo_Product.[Product_ID] = '" & Code & "' AND
dbo_Product.[Discontinued]= 0)", Cnxn, adOpenKeyset
rstNum = rstData.RecordCount
rstData.Close
Set rstData = Nothing
Another similar thing that isn't working on another computer but working on
mine is:
I have a form (the same app) and I'm establishing the connection on the form
opening and close it with the form unloading.The recordset isn't working
there. The connection name is the same Cnxn. I've tried to give different
names to the connections and recordsets but it doesn't help.
Please, advise what can be wrong with all this stuff.
Thanks