Click to See Complete Forum and Search --> : Methods Support


hoa01206
October 15th, 2001, 12:42 PM
Hello all,

Here is my problem:

The MSDN help line states that:
(For example, the OLE DB Provider for Microsoft Jet supports Seek and Index.)
Microsoft.Jet.OLEDB.4.0




If rs_Table.Supports(adIndex) And rs_Table.Supports(adSeek) Then
end if

But when I try to use the support method to verify that, the return value is false. Thus, I can not use the methods Index and Seek.
Could anyone help please.

Thanks
Hisham

Cakkie
October 16th, 2001, 01:26 AM
This could be because of the selected cursortype or locktype. You must use a recordsource that enables you to move back and forth through your recordset. Try opening the recordset using the adKeyset or adDynamic cursor type.

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook

hoa01206
October 16th, 2001, 08:00 AM
Hi,

Here is my code:
rs_Table.Open Table_Name, ConnA.Get_conn, adOpenDynamic, adLockOptimistic, adCmdTableDirect


But when I use

If rs_Table.Supports(adIndex) And rs_Table.Supports(adIndex) Then

End If

It always evaluate false meaning it is not supporting the two methods.

Any Ideas?



Thanks
Hisham

Vafis
October 16th, 2001, 08:46 AM
the seek operation is only supported by server-based cursors(CursorLocation=adUseServer).This is because it uses the cursor service and indexes on the provider rather than the facilities of ADO.

hoa01206
October 16th, 2001, 08:52 AM
Thank you very much.

Thanks
Hisham

hoa01206
October 16th, 2001, 09:09 AM
Hi,

Initially I thought its working but it is not. Even though I have used the server side location but it is not working. I am executing on Access 97 database. Here is my code:

rs_Table.CursorLocation = adUseServer

rs_Table.Open Table_Name, ConnA.Get_conn, adOpenKeyset, adLockReadOnly, adCmdTableDirect

---------------------> it is not passing through
If rs_Table.Supports(adIndex) Then
MsgBox "HI"
End If

Thanks
Hisham

Vafis
October 16th, 2001, 01:49 PM
Use the property cursorlocation on the connection
property or both recordset and connection objects
General OLEDB Provider and ODBC does not support some properties of ADO objects such as recordcount.
In my opinion you should connect using ODBC driver
or I think that there is a new version of OLEDB
provider that may support these properties.See microsoft site.

hoa01206
October 16th, 2001, 03:58 PM
Thanks for the tip. I'll try to get the new provider.

Thanks
Hisham