Board index » delphi » Rewriting previous post... HOW TO FIND A RECORD

Rewriting previous post... HOW TO FIND A RECORD

Hi again,

I need help, I must get free of Locate method! Because it is too slow to
find a record in an AdoDataSet.

Doesn't  anybody use other methods to find a record using the key fields (or
any other index).???
thanks in advance

erdem.

Quote
Erdem Gunay <erdem_gu...@hotmail.com> wrote in message

news:8tuggv$3g51@bornews.borland.com...
Quote
> Hi,

> what is the best way (in terms of performance) to find a record using Key
> fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> thanks in advance.

> erdem.

 

Re:Rewriting previous post... HOW TO FIND A RECORD


Erdem,

I haven't used the tadodataset directly, and I'm not sure what you're trying
to do...

To locate records, I use a seperate query. I somehow determine the key
fields for the record I want, then shoot off a query to get just that
record.

Mike Walsh

Quote
"Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message

news:8ubf7j$4ev5@bornews.inprise.com...
Quote
> Hi again,

> I need help, I must get free of Locate method! Because it is too slow to
> find a record in an AdoDataSet.

> Doesn't  anybody use other methods to find a record using the key fields
(or
> any other index).???
> thanks in advance

> erdem.

> Erdem Gunay <erdem_gu...@hotmail.com> wrote in message
> news:8tuggv$3g51@bornews.borland.com...
> > Hi,

> > what is the best way (in terms of performance) to find a record using
Key
> > fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> > thanks in advance.

> > erdem.

Re:Rewriting previous post... HOW TO FIND A RECORD


you can use the ADODataSet.RecordSet.Find

David  agros...@arava.co.il

Quote
"Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message

news:8ubf7j$4ev5@bornews.inprise.com...
Quote
> Hi again,

> I need help, I must get free of Locate method! Because it is too slow to
> find a record in an AdoDataSet.

> Doesn't  anybody use other methods to find a record using the key fields
(or
> any other index).???
> thanks in advance

> erdem.

> Erdem Gunay <erdem_gu...@hotmail.com> wrote in message
> news:8tuggv$3g51@bornews.borland.com...
> > Hi,

> > what is the best way (in terms of performance) to find a record using
Key
> > fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> > thanks in advance.

> > erdem.

Re:Rewriting previous post... HOW TO FIND A RECORD


thanks alot David, but I can not use Find because Find performs search using
only one criteria. this is not the case, I must be able to search a record
using 4 field values.The documentation says :
    "Only a single-column name may be specified for the criterion. In other
words, this method does not support multi-column searches."
Instead of Find, Seek method can be used to search on multiple columns.
However, the providers (OLE DB PROVIDER for SQL Server, OLE DB PROVIDER for
ODBC Drivers) that I use do not support Seek. !

what should I do ?

Quote
David B.E <agros...@arava.co.il> wrote in message

news:8uclim$j5n1@bornews.inprise.com...
Quote
> you can use the ADODataSet.RecordSet.Find

> David  agros...@arava.co.il

> "Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message
> news:8ubf7j$4ev5@bornews.inprise.com...
> > Hi again,

> > I need help, I must get free of Locate method! Because it is too slow to
> > find a record in an AdoDataSet.

> > Doesn't  anybody use other methods to find a record using the key fields
> (or
> > any other index).???
> > thanks in advance

> > erdem.

> > Erdem Gunay <erdem_gu...@hotmail.com> wrote in message
> > news:8tuggv$3g51@bornews.borland.com...
> > > Hi,

> > > what is the best way (in terms of performance) to find a record using
> Key
> > > fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> > > thanks in advance.

> > > erdem.

Re:Rewriting previous post... HOW TO FIND A RECORD


Hi
I have to say I never had problems with locate Myself
if the fields are indexed of course,
how many records are on your tables?,  which database are you using? what
cursor type?

David agros...@arava.co.il

Quote
"Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message

news:8udm7b$pfn2@bornews.inprise.com...
Quote
> thanks alot David, but I can not use Find because Find performs search
using
> only one criteria. this is not the case, I must be able to search a record
> using 4 field values.The documentation says :
>     "Only a single-column name may be specified for the criterion. In
other
> words, this method does not support multi-column searches."

> Instead of Find, Seek method can be used to search on multiple columns.
> However, the providers (OLE DB PROVIDER for SQL Server, OLE DB PROVIDER
for
> ODBC Drivers) that I use do not support Seek. !

> what should I do ?

> David B.E <agros...@arava.co.il> wrote in message
> news:8uclim$j5n1@bornews.inprise.com...
> > you can use the ADODataSet.RecordSet.Find

> > David  agros...@arava.co.il

> > "Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message
> > news:8ubf7j$4ev5@bornews.inprise.com...
> > > Hi again,

> > > I need help, I must get free of Locate method! Because it is too slow
to
> > > find a record in an AdoDataSet.

> > > Doesn't  anybody use other methods to find a record using the key
fields
> > (or
> > > any other index).???
> > > thanks in advance

> > > erdem.

> > > Erdem Gunay <erdem_gu...@hotmail.com> wrote in message
> > > news:8tuggv$3g51@bornews.borland.com...
> > > > Hi,

> > > > what is the best way (in terms of performance) to find a record
using
> > Key
> > > > fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> > > > thanks in advance.

> > > > erdem.

Re:Rewriting previous post... HOW TO FIND A RECORD


Hi,

The problem with Locate is that Locate does not seem to use index
information although there is a Primary Key index on the table.

I am using Delphi 5, ADO Express, MDAC 2.6, SQL Server 7.0.

Dataset's Cursor location is clUseClient, cursor type is ctStatic.

any idea ???

Quote
David B.E <agros...@arava.co.il> wrote in message

news:8uergk$a4n1@bornews.inprise.com...
Quote
> Hi
> I have to say I never had problems with locate Myself
> if the fields are indexed of course,
> how many records are on your tables?,  which database are you using? what
> cursor type?

> David agros...@arava.co.il

> "Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message
> news:8udm7b$pfn2@bornews.inprise.com...
> > thanks alot David, but I can not use Find because Find performs search
> using
> > only one criteria. this is not the case, I must be able to search a
record
> > using 4 field values.The documentation says :
> >     "Only a single-column name may be specified for the criterion. In
> other
> > words, this method does not support multi-column searches."

> > Instead of Find, Seek method can be used to search on multiple columns.
> > However, the providers (OLE DB PROVIDER for SQL Server, OLE DB PROVIDER
> for
> > ODBC Drivers) that I use do not support Seek. !

> > what should I do ?

> > David B.E <agros...@arava.co.il> wrote in message
> > news:8uclim$j5n1@bornews.inprise.com...
> > > you can use the ADODataSet.RecordSet.Find

> > > David  agros...@arava.co.il

> > > "Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message
> > > news:8ubf7j$4ev5@bornews.inprise.com...
> > > > Hi again,

> > > > I need help, I must get free of Locate method! Because it is too
slow
> to
> > > > find a record in an AdoDataSet.

> > > > Doesn't  anybody use other methods to find a record using the key
> fields
> > > (or
> > > > any other index).???
> > > > thanks in advance

> > > > erdem.

> > > > Erdem Gunay <erdem_gu...@hotmail.com> wrote in message
> > > > news:8tuggv$3g51@bornews.borland.com...
> > > > > Hi,

> > > > > what is the best way (in terms of performance) to find a record
> using
> > > Key
> > > > > fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> > > > > thanks in advance.

> > > > > erdem.

Re:Rewriting previous post... HOW TO FIND A RECORD


I don't know about SQL Server but I use Access2000 and if you set the cursor
to server, TableDirect to true, and have an index set for the column you
wish to find you can use Seek.  In tests with an index set you should be
able to find any record within 1 or 2 seconds even if you have over a
billion records. But as I said I only have information that is valid with
Access2000.  ADO command Seek says you need to set the Cursor to server and
TableDirect to True to work.  Should work with SQL Server.

Bob

Quote
"Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message

news:8ugfa3$nhs7@bornews.inprise.com...
Quote
> Hi,

> The problem with Locate is that Locate does not seem to use index
> information although there is a Primary Key index on the table.

> I am using Delphi 5, ADO Express, MDAC 2.6, SQL Server 7.0.

> Dataset's Cursor location is clUseClient, cursor type is ctStatic.

> any idea ???

> David B.E <agros...@arava.co.il> wrote in message
> news:8uergk$a4n1@bornews.inprise.com...
> > Hi
> > I have to say I never had problems with locate Myself
> > if the fields are indexed of course,
> > how many records are on your tables?,  which database are you using?
what
> > cursor type?

> > David agros...@arava.co.il

> > "Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message
> > news:8udm7b$pfn2@bornews.inprise.com...
> > > thanks alot David, but I can not use Find because Find performs search
> > using
> > > only one criteria. this is not the case, I must be able to search a
> record
> > > using 4 field values.The documentation says :
> > >     "Only a single-column name may be specified for the criterion. In
> > other
> > > words, this method does not support multi-column searches."

> > > Instead of Find, Seek method can be used to search on multiple
columns.
> > > However, the providers (OLE DB PROVIDER for SQL Server, OLE DB
PROVIDER
> > for
> > > ODBC Drivers) that I use do not support Seek. !

> > > what should I do ?

> > > David B.E <agros...@arava.co.il> wrote in message
> > > news:8uclim$j5n1@bornews.inprise.com...
> > > > you can use the ADODataSet.RecordSet.Find

> > > > David  agros...@arava.co.il

> > > > "Erdem Gunay" <erdem_gu...@hotmail.com> wrote in message
> > > > news:8ubf7j$4ev5@bornews.inprise.com...
> > > > > Hi again,

> > > > > I need help, I must get free of Locate method! Because it is too
> slow
> > to
> > > > > find a record in an AdoDataSet.

> > > > > Doesn't  anybody use other methods to find a record using the key
> > fields
> > > > (or
> > > > > any other index).???
> > > > > thanks in advance

> > > > > erdem.

> > > > > Erdem Gunay <erdem_gu...@hotmail.com> wrote in message
> > > > > news:8tuggv$3g51@bornews.borland.com...
> > > > > > Hi,

> > > > > > what is the best way (in terms of performance) to find a record
> > using
> > > > Key
> > > > > > fields in ADODataSet using delphi 5, mdac 2.6, sql server 7.0 .

> > > > > > thanks in advance.

> > > > > > erdem.

Other Threads