|
-
Sep 25th, 1999, 04:29 AM
#1
Thread Starter
New Member
Why the following code gives an error message
at
<rst.Index = "PrimaryKey">
"Compile error
Method or data member not found"
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Set cnn = New ADODB.Connection
cnn.Open "provider=Microsoft.Jet.OLEDB.4.0;data source = c:\project\vb\access\masters.mdb;"
Set rst = New ADODB.Recordset
rst.Index = "PrimaryKey"
rst.Open "Itemmast", cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect
rst.Seek "=", Text1.Text
If Not rst.EOF Then
Form1.Text2.Text = rst.Fields(1).Value
End If
rst.Close
-
Sep 26th, 1999, 10:38 PM
#2
ADO's Recordset object doesn't have Seek method. It has Find method.
Usage:rs.Find Criteria, [Skip Records As Long], [Search Direction As SearchDirectionEnum=adSearchForward], [Start]
Example:rs.Find "LastName Like 'A%'"
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
[This message has been edited by Serge (edited 09-27-1999).]
-
Sep 27th, 1999, 04:34 AM
#3
Thread Starter
New Member
Thanks for your information.
I found some examples in MSDN Library (July 1999) under the following heading
"Microsoft Data Access Components 2.5 SDK Beta - ADO"
Is the above one is a new component ?
Thanks & Regards
Vijman
-
Sep 27th, 1999, 06:20 PM
#4
ADO 2.5 will be released with Windows2000. The new version of ADO will have XML support (which is pretty cool, I've seen it in action on Microsoft DevDays conference).
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|