F
fox
Hi!
I am try to debug a program, but I can't figure out the problem. When I
call this function, it show "Run-time error 3709 The connection cannot be
used to perform this operation." Please tell me where could be wrong. Thank
you very much.
fox
The error happen at " And [CKey] = '" & AstrKey & "'"
Here is the function.
Dim rs As ADODB.Recordset
Set rs = new ADODB.Recordset
With rs
.ActiveConnection = Gn
.Open Source:="Select * " & _
"From [SCtl] " & _
" Where [CType] = '" & AstrType & "' " & _
" And [CKey] = '" & AstrKey & "'"
If Not .EOF Then
.MoveFirst
GetID = rs![ID].Value
Else
GetID = 0
End If
End With
rs.Close
Set rs = Nothing
I am try to debug a program, but I can't figure out the problem. When I
call this function, it show "Run-time error 3709 The connection cannot be
used to perform this operation." Please tell me where could be wrong. Thank
you very much.
fox
The error happen at " And [CKey] = '" & AstrKey & "'"
Here is the function.
Dim rs As ADODB.Recordset
Set rs = new ADODB.Recordset
With rs
.ActiveConnection = Gn
.Open Source:="Select * " & _
"From [SCtl] " & _
" Where [CType] = '" & AstrType & "' " & _
" And [CKey] = '" & AstrKey & "'"
If Not .EOF Then
.MoveFirst
GetID = rs![ID].Value
Else
GetID = 0
End If
End With
rs.Close
Set rs = Nothing