M
Mark Dudley
Guest
I have a database which started life in Access 2, and which has grown over time. It is now in Access 2000, but is now far too cumbersome and belatedly I am trying to split it into Front and Back ends. Unfortunately a lot of the code breaks when I split it, and the problem seems to be that all of the code uses DAO.
So I decided to rewrite it using ADO. The problem I now have is that certain of the methods no longer seem to work.
eg. The old database had:
Dim Msg, Style, Title, Help, Ctxt, Response, MyValue, MyName
Dim Db As Database, portset
Set Db = DBEngine.Workspaces(0).Databases(0)
Set portset = Db.OpenRecordset("tblStaffInOut")
portset.Index = "Initials"
portset.Seek "=", LGIN
If portset.NoMatch Then
MsgBox "Please use a valid Log In"
Else
MyName = portset!Name
If Time < #12:00:00 PM# Then
MsgBox "Good morning " & MyName & ". It is " & Now & ". You are now logged in."
Else
MsgBox "Good afternoon " & MyName & ". It is " & Now & ". You are now logged in."
End If
portset.Edit
portset![In/Out] = "In"
portset![Back] = Null
portset.Update
End If
I have changed this to:
Dim portset As New ADODB.Recordset
portset.Open "tblStaffInOut", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
portset.Index = "Initials"
portset.Seek "=", LGIN
If portset.NoMatch Then
MsgBox "Please use a valid Log In"
...
But the code stops at "If portset.NoMatch" with a compile error saying "Method or data member not found". Is this no longer allowed?
So I decided to rewrite it using ADO. The problem I now have is that certain of the methods no longer seem to work.
eg. The old database had:
Dim Msg, Style, Title, Help, Ctxt, Response, MyValue, MyName
Dim Db As Database, portset
Set Db = DBEngine.Workspaces(0).Databases(0)
Set portset = Db.OpenRecordset("tblStaffInOut")
portset.Index = "Initials"
portset.Seek "=", LGIN
If portset.NoMatch Then
MsgBox "Please use a valid Log In"
Else
MyName = portset!Name
If Time < #12:00:00 PM# Then
MsgBox "Good morning " & MyName & ". It is " & Now & ". You are now logged in."
Else
MsgBox "Good afternoon " & MyName & ". It is " & Now & ". You are now logged in."
End If
portset.Edit
portset![In/Out] = "In"
portset![Back] = Null
portset.Update
End If
I have changed this to:
Dim portset As New ADODB.Recordset
portset.Open "tblStaffInOut", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
portset.Index = "Initials"
portset.Seek "=", LGIN
If portset.NoMatch Then
MsgBox "Please use a valid Log In"
...
But the code stops at "If portset.NoMatch" with a compile error saying "Method or data member not found". Is this no longer allowed?