J
John H W
I am getting error 3709: "Operation is not allowed on an object referencing a
closed or invalid connection" when I try to open a recordset. I get the error
on the line that starts with an '>."
Function follows:
Public Function CheckEmployment(ByVal dtIntroDate As Date) As Boolean
Dim lJASID As Long
Dim strQuery As String
Dim rst As ADODB.Recordset
lJASID = WorkFirstCode.GetJASID()
strQuery = "SELECT * FROM Employment " & _
"WHERE JASID=" & CStr(lJASID) & " _
AND IntroDate=#" & CStr(dtIntroDate) & "#;"
Set rst = New ADODB.Recordset
If rst!JASID = CStr(lJASID) And rst!IntroDate = CStr(dtIntroDate) Then
CheckEmployment = True
Else
CheckEmployment = False
End If
"Employment" is the name of the table (in the same database) that I am
trying to open.
Thanks for any ideas.
John H W
rst.Close
End Function
closed or invalid connection" when I try to open a recordset. I get the error
on the line that starts with an '>."
Function follows:
Public Function CheckEmployment(ByVal dtIntroDate As Date) As Boolean
Dim lJASID As Long
Dim strQuery As String
Dim rst As ADODB.Recordset
lJASID = WorkFirstCode.GetJASID()
strQuery = "SELECT * FROM Employment " & _
"WHERE JASID=" & CStr(lJASID) & " _
AND IntroDate=#" & CStr(dtIntroDate) & "#;"
Set rst = New ADODB.Recordset
rst.Open (strQuery)
If rst!JASID = CStr(lJASID) And rst!IntroDate = CStr(dtIntroDate) Then
CheckEmployment = True
Else
CheckEmployment = False
End If
"Employment" is the name of the table (in the same database) that I am
trying to open.
Thanks for any ideas.
John H W
rst.Close
End Function