|
-
Jan 19th, 2000, 08:48 PM
#1
Thread Starter
New Member
I have been using DAO for a while now and use the SEEK command to jump to records based on an index set. I have now converted an app over to ADO and have noticed there is no SEEK command. I have been using the FIND Command but that seems extremely slow in comparison. Is there another way in ADO of achieving this and also sppeding up the execution ?
Mucho Graciaso !
-
Jan 20th, 2000, 12:19 PM
#2
Guru
You can optimize a field at runtime by setting the dynamic "OPTIMIZE" value at runtime. Then you can use ADOs FIND, SORT, and FILTER that take advantage of these indexes. These indexes are created at runtime and DO NOT change any values/properties in your underlying table.
Code:
Dim rs As Recordset
Dim cn As Connection
Dim fld As Field
Set cn = New Connection
Set rs = New Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NWind2k.mdb"
With rs
.ActiveConnection = cn
.Source = "Customers"
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open
Set fld = .Fields("CustomerID")
fld.Properties.Item("Optimize").Value = True
.Find = "CustomerID = 'FRANR'"
If .RecordCount > 0 Then
MsgBox "Found!"
Else
MsgBox "Not Found!"
End If
End With
-
Mar 29th, 2000, 11:09 PM
#3
Thread Starter
New Member
I tried the mentioned code and couldnt get it to work !
Any Ideas ???
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
|