BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using SEEK on a TADODataSet

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Brian Wheatley
Guest





PostPosted: Mon Aug 30, 2004 3:12 pm    Post subject: Using SEEK on a TADODataSet Reply with quote



Hello,

I have an application with a TADOConnection and a TADODataSet on a data
module form. The TADOConnection is connection to a MS SQL Server database,
and the TADODataSet's CommandText property is as follows:

SELECT * FROM CAPACITY

The CAPACITY table has a primary key on a MODEL_NO field, and a secondary
index IX_MODEL on MODEL (not MODEL_NO) and CAPACITY fields.

The documentation for the SEEK method states that the index name must be
set. However, the index names do not appear in the design environment. I can
type in IX_MODEL but the SEEK method still does not work. I also tried
setting the IndexFields property to MODEL;CAPACITY but that did not work
either.

The table will open and I can edit the data using a db grid, I just can't
get the SEEK method to work.

Can anyone tell me exactly what I need to do, step by step, to use the seek
method?

Thank you,
Brian Wheatley




Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Mon Aug 30, 2004 3:51 pm    Post subject: Re: Using SEEK on a TADODataSet Reply with quote



MS SQL Server OLEDB provider does not support indeces (they are used when
preparing queries, of course, but not exposed to user). Only one MS OLEDB
provider supports them - MS Jet (MS Access).

//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)

"Brian Wheatley" <brianpw (AT) neo (DOT) rr.com> сообщил/сообщила в новостях следующее:
news:413343d1$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hello,

I have an application with a TADOConnection and a TADODataSet on a data
module form. The TADOConnection is connection to a MS SQL Server database,
and the TADODataSet's CommandText property is as follows:

SELECT * FROM CAPACITY

The CAPACITY table has a primary key on a MODEL_NO field, and a secondary
index IX_MODEL on MODEL (not MODEL_NO) and CAPACITY fields.

The documentation for the SEEK method states that the index name must be
set. However, the index names do not appear in the design environment. I
can
type in IX_MODEL but the SEEK method still does not work. I also tried
setting the IndexFields property to MODEL;CAPACITY but that did not work
either.

The table will open and I can edit the data using a db grid, I just can't
get the SEEK method to work.

Can anyone tell me exactly what I need to do, step by step, to use the
seek
method?

Thank you,
Brian Wheatley







Back to top
Brian Wheatley
Guest





PostPosted: Mon Aug 30, 2004 5:16 pm    Post subject: Re: Using SEEK on a TADODataSet Reply with quote




Actually, I don't believe that is the case. I changed the CommandType
property to cmdTable and CommandText to the name of the table (CAPACITY).
The index names now show up, but the seek command still isn't working.

Brian


Back to top
Del Murray
Guest





PostPosted: Mon Aug 30, 2004 6:08 pm    Post subject: Re: Using SEEK on a TADODataSet Reply with quote

Actually that was right. You were using tADODataset, you are now using
tADOTable. tADOTable is something you dont want to use unless the table is
very very small, (< 100 rows) because every time you open the table it
reads the "whole" table into memory.
Use the "locate" method with the tADODataset. It will work ok. Seek worked
fine with the old BDE but you dont want that either.


Back to top
Brian Wheatley
Guest





PostPosted: Mon Aug 30, 2004 6:09 pm    Post subject: Re: Using SEEK on a TADODataSet Reply with quote

Thank you! I was thinking that I needed to use SEEK instead of LOCATE. That
explains my confusion.

Brian


"Del Murray" <Del.Murray (AT) CreditHawk (DOT) Net.NoSpam> wrote

Quote:
Actually that was right. You were using tADODataset, you are now using
tADOTable. tADOTable is something you dont want to use unless the table is
very very small, (< 100 rows) because every time you open the table it
reads the "whole" table into memory.
Use the "locate" method with the tADODataset. It will work ok. Seek worked
fine with the old BDE but you dont want that either.





Back to top
Del Murray
Guest





PostPosted: Mon Aug 30, 2004 10:35 pm    Post subject: Re: Using SEEK on a TADODataSet Reply with quote

Well, it might not explain your confusion but it might make your program
work better .... :-)


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.