Hi
I'm having problems converting to ADO,listed below is my existing code for DAO, can you please help me figure out the proper code.
DAO Code: "Works"
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\AOPT1.mdb", False, False, "MS Access; PWD=MANXYZ")
Set RS = db.OpenRecordset("aop6a")
SQL = "SELECT DISTINCT SN, AGD1, CTRYX FROM AOP6A WHERE SN like """ & n & "*"" AND CTRYX LIKE " & S & " ORDER BY SN"
Set RS = db.OpenRecordset(SQL, dbOpenSnapshot)
Set Data5.Recordset = RS
ADO Code: (Doesn't work)
Set Db = New ADODB.Connection
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Password=MANXYZ;Persist Security Info=True;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\AOPT1.mdb"
'Error message from line above:
Can't start your application. The workgroup information file is missing or opened exclusively by another user.
oRS.Open "SELECT * FROM aop6a", Db, adOpenDynamic, adLockReadOnly
Set Adodc1.Recordset = oRS
oRS.Close
Db.close
Can you please help me with the ADO code?
Thanks.
victor
I'm having problems converting to ADO,listed below is my existing code for DAO, can you please help me figure out the proper code.
DAO Code: "Works"
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\AOPT1.mdb", False, False, "MS Access; PWD=MANXYZ")
Set RS = db.OpenRecordset("aop6a")
SQL = "SELECT DISTINCT SN, AGD1, CTRYX FROM AOP6A WHERE SN like """ & n & "*"" AND CTRYX LIKE " & S & " ORDER BY SN"
Set RS = db.OpenRecordset(SQL, dbOpenSnapshot)
Set Data5.Recordset = RS
ADO Code: (Doesn't work)
Set Db = New ADODB.Connection
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Password=MANXYZ;Persist Security Info=True;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\AOPT1.mdb"
'Error message from line above:
Can't start your application. The workgroup information file is missing or opened exclusively by another user.
oRS.Open "SELECT * FROM aop6a", Db, adOpenDynamic, adLockReadOnly
Set Adodc1.Recordset = oRS
oRS.Close
Db.close
Can you please help me with the ADO code?
Thanks.
victor