SEEK and INDEX whith ADO ??? 
Author Message
 SEEK and INDEX whith ADO ???

Hi,

That means that when you connect to database you are using some provider,
like OLEDB Jet, SQL OLEDB and not all of those providers support
functionality related to Seek and Index. As fas as I know only OLEDB JET 4.0
supports that functionality, which means that you could use Index and Seek
with Access database.

--
Val Mazur
Microsoft MVP


Quote:
> Hi,
> sorry for my language,
> but i'm italian.
> I want use a Key("PrimaryKey") in a Access DB,
> with the Method Seek of ADO: can i realize it, like in DAO ??
> l'Help tell me that i can realize it "if the provider can support the
> property Index and the
> method Seek" : what it mean ??
> Thank to all

> Hi,ciao



Sat, 05 Mar 2005 23:55:32 GMT  
 SEEK and INDEX whith ADO ???
Thank, i have learn something of new.
But now i have write this code and it not function again
Why ?

   'string connection before
   'sdbCnn = "DSN=MS Access 97
Database;DBQ=c:\Temp\UniMag.mdb;DefaultDir=c:\Temp;DriverId=281;FIL=MS
Access;FILEDSN=C:\Programmi\File comuni\ODBC\Data Sources\MS Access 97
Database (not sharable).dsn;MaxBufferSize=2048;PageTimeout=5;UID=admin;"

'string connection current
    sdbCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Temp\UniMag.mdb;Persist Security Info=False"
    Set DBCnn = New ADODB.Connection
    DBCnn.Open sdbCnn
    vMatr(0) = "2020520122"
    Set rec = New ADODB.Recordset

    rec.CursorLocation = adUseServer
    rec.Open "Prodotti", DBCnn, , , adCmdTable
    Dim b As Boolean
    b = b
    b = rec.Supports(adIndex) ' result FALSE (will be must TRUE)

    rec.Index = "PrimaryKey"
    rec.Seek vMatr(), adSeekFirstEQ
    rec.Find "CodProdotto = '" & "43340480178" & "'"

Thank and ciao



Quote:
> Hi,

> That means that when you connect to database you are using some provider,
> like OLEDB Jet, SQL OLEDB and not all of those providers support
> functionality related to Seek and Index. As fas as I know only OLEDB JET
4.0
> supports that functionality, which means that you could use Index and Seek
> with Access database.

> --
> Val Mazur
> Microsoft MVP



> > Hi,
> > sorry for my language,
> > but i'm italian.
> > I want use a Key("PrimaryKey") in a Access DB,
> > with the Method Seek of ADO: can i realize it, like in DAO ??
> > l'Help tell me that i can realize it "if the provider can support the
> > property Index and the
> > method Seek" : what it mean ??
> > Thank to all

> > Hi,ciao



Sun, 06 Mar 2005 00:12:14 GMT  
 SEEK and INDEX whith ADO ???
Hi,

If  rec.Supports(adIndex)  returns False, then you definitely cannot use
Index. Check Find method and Filter property of recordset. This
functionality does not depend on provider and works with all datasources.
maybe it could replace your functionality

--
Val Mazur
Microsoft MVP


Quote:
> Thank, i have learn something of new.
> But now i have write this code and it not function again
> Why ?

>    'string connection before
>    'sdbCnn = "DSN=MS Access 97
> Database;DBQ=c:\Temp\UniMag.mdb;DefaultDir=c:\Temp;DriverId=281;FIL=MS
> Access;FILEDSN=C:\Programmi\File comuni\ODBC\Data Sources\MS Access 97
> Database (not sharable).dsn;MaxBufferSize=2048;PageTimeout=5;UID=admin;"

> 'string connection current
>     sdbCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Temp\UniMag.mdb;Persist Security Info=False"
>     Set DBCnn = New ADODB.Connection
>     DBCnn.Open sdbCnn
>     vMatr(0) = "2020520122"
>     Set rec = New ADODB.Recordset

>     rec.CursorLocation = adUseServer
>     rec.Open "Prodotti", DBCnn, , , adCmdTable
>     Dim b As Boolean
>     b = b
>     b = rec.Supports(adIndex) ' result FALSE (will be must TRUE)

>     rec.Index = "PrimaryKey"
>     rec.Seek vMatr(), adSeekFirstEQ
>     rec.Find "CodProdotto = '" & "43340480178" & "'"

> Thank and ciao



> > Hi,

> > That means that when you connect to database you are using some
provider,
> > like OLEDB Jet, SQL OLEDB and not all of those providers support
> > functionality related to Seek and Index. As fas as I know only OLEDB JET
> 4.0
> > supports that functionality, which means that you could use Index and
Seek
> > with Access database.

> > --
> > Val Mazur
> > Microsoft MVP



> > > Hi,
> > > sorry for my language,
> > > but i'm italian.
> > > I want use a Key("PrimaryKey") in a Access DB,
> > > with the Method Seek of ADO: can i realize it, like in DAO ??
> > > l'Help tell me that i can realize it "if the provider can support the
> > > property Index and the
> > > method Seek" : what it mean ??
> > > Thank to all

> > > Hi,ciao



Sun, 06 Mar 2005 01:03:00 GMT  
 SEEK and INDEX whith ADO ???
Hi,
sorry for my language,
but i'm italian.
I want use a Key("PrimaryKey") in a Access DB,
with the Method Seek of ADO: can i realize it, like in DAO ??
l'Help tell me that i can realize it "if the provider can support the
property Index and the
method Seek" : what it mean ??
Thank to all

Hi,ciao



Sat, 05 Mar 2005 23:17:43 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. ADO Index property and Seek method

2. Index Property/SEEK method Problem with ADO

3. Seek, Index on ADO Recordset

4. Seek - Index. ADO 2.1

5. Seek - Index. ADO 2.1

6. Index and Seek in ADO

7. ADO USING SEEK AND INDEXES

8. ADO Seek, Index

9. Bind grid to recordset whith OraOLEDB Provider for ADO

10. using .index and .seek function

11. Problems with the methods Index and Seek

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

 

 
Powered by phpBB® Forum Software