dao转到ado
以下的function中如何将dao.Recordset 转换到adodb.Recordset上来:
Public Function DaoSeek2Exactly(ByRef TBOBJ As dao.Recordset, keyfield1, keyfield2, Key1, Key2)
Dim ok, Tempkey, tempmark
If TBOBJ.EOF And TBOBJ.BOF Then
ok = False
Else
ok = False
TBOBJ.Seek ">=", Key1, Key2
If Not TBOBJ.NoMatch Then
Tempkey = UCase(Key1)
tempmark = TBOBJ.Bookmark
Do While Tempkey = UCase(TBOBJ(keyfield1)) And UCase(Key2) = UCase(TBOBJ(keyfield2))
If TBOBJ(keyfield2) = Key2 Then
SeekExactly = True
ok = True
Exit Do
End If
TBOBJ.MoveNext
If TBOBJ.EOF Then Exit Do
Loop
'If Not ok Then
'TBOBJ.Bookmark = tempmark
'ok = True
'End If
End If
End If
DaoSeek2Exactly = ok
End Function