Why I can't use index and seek in all Access database 
Author Message
 Why I can't use index and seek in all Access database

  Hi everybody!
First the code:

  Private Sub Form_Load()

       Dim Con As New ADODB.Connection

       Dim Rec As New ADODB.Recordset

  With Con

        .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

Line1:                "Data Source=c:\Program Files\Microsoft
Office\Office\Samples\northwind.mdb;" & _

                "user id=admin;password=;"

        .CursorLocation = adUseServer

        .Open

  End With

  Rec.Open "customers", Con, adOpenKeyset, adLockReadOnly, adCmdTableDirect

 Set MSHFlexGrid1.DataSource = Rec

 'adIndex  i adSeek je Support samo ako je .CursorLocation = adUseServer i
adCmdTableDirect

 If Rec.Supports(adIndex) And Rec.Supports(adSeek) Then

....

End Sub

For previous, I have problem with seek and index metod . I use the same code
(I only change  Data Source in Line1) for few  Access database, but for some
I can use seek and index metod (ADO) and for other I cant't.

For example when Line1 is: Data Source=c:\Program Files\Microsoft
Office\Office\Samples\northwind.mdb

  I can use index and seek, but when is

Data Source=d:\base\mybase.mdb

I can't use index and seek

In immediate Window when I write

Print con for this 2 database I have been noticed 2 different

For database where I can use index and seek:

Type=5

Database Locking Mode=1

And for database where I can't use seek and index

Type=4

Database Locking Mode=0

 What could  I do to solve this problem??? I need to be able use index and
seek in all databases?



Mon, 03 May 2004 16:36:25 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. 2 questions: Code doesn't work when I split database and Seek/Index question

2. Using seek and index with text database

3. Please Help, Why VB3 Application Can't Find Database Index

4. Please Help, Why VB3 Application Can't Find Database Index

5. why can't I seek queries on vb5 using access97 mdb files in a hospital

6. why can't I seek queries on vb5 using access97 mdb files in a hospital

7. Case sensitive seek using an Access database

8. How do i access a Btrieve database with VB using indexes

9. 'Canned' data in VB program

10. using .index and .seek function

11. Using SEEK wih multiple-field indexes

12. Help : Seeking record using Index

 

 
Powered by phpBB® Forum Software