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 

Why Does "Seek" method not work?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Bpk. Adi Wira Kusuma
Guest





PostPosted: Mon Apr 11, 2005 6:39 pm    Post subject: Why Does "Seek" method not work? Reply with quote



I use ADO to connect SQL Server. But why Does the "Seek" method not work?
Though I have set the properties according to Delphi 's manual book.

I have tried for the call of " Refresh" method. But my showing data do not
want to change. In fact, what is function "Refresh" method?




Back to top
Kevin Frevert
Guest





PostPosted: Tue Apr 12, 2005 5:28 pm    Post subject: Re: Why Does "Seek" method not work? Reply with quote



"Bpk. Adi Wira Kusuma" <adi_wira_kusuma (AT) yahoo (DOT) com.sg> wrote

Quote:
I use ADO to connect SQL Server. But why Does the "Seek" method not work?
Though I have set the properties according to Delphi 's manual book.

Seek is dependent on if the underlying connection provider (in MSSQL's case
OLE-DB) interface supports index functionality used in the Seek method (I
believe MSSQL's provider does not).
Use Locate instead.

Quote:
I have tried for the call of " Refresh" method. But my showing data do not
want to change. In fact, what is function "Refresh" method?

Refresh works for me. Can you provide an example?

Good luck,
krf



Back to top
Bpk. Adi Wira Kusuma
Guest





PostPosted: Thu Apr 14, 2005 1:54 am    Post subject: Re: Why Does "Seek" method not work? Reply with quote



my table (TADOTable) has been active. Then I execute SQL at TADOQuery, which
its contents:

Insert into ....................

After success, I call "Refresh" method at TADOTable. but I cannot see new
record at DBGrid.

//================

ADOTable1.Open;
ADOQuery1.ExecSQL; // execute "Insert Into............
ADOTable1.Refresh;
// Why Can I not see the changing record?


Back to top
Kevin Frevert
Guest





PostPosted: Thu Apr 14, 2005 12:45 pm    Post subject: Re: Why Does "Seek" method not work? Reply with quote

Adi,

A few things
#1 - Never use table based components against a set-based RDBMS. Always use
the set-based components.
http://bdn.borland.com/article/0,1410,28160,00.htm

#2 - Using TADODataSet, the Refresh method worked fine for me, but I
typically call Close/Open to refresh my datasets. If you are going to run
your own scripts to insert/update/delete data, I recommend using the
TADOCommand component. It's "closer" to the ADO layer than TADOQuery (which
was only written to be a conduit for BDE apps using TQuery).

#3 - I recommend data access using the TADODataSet instead of TADOQuery
(same reasons in #2).

#4 - Learn to write SQL. Learn database normalization and C/S application
design. You haven't posted a question yet that has anything directly to do
with Delphi, but more general SQL questions. Once you get comfortable with
SQL and know the basics about Client/Server applications, the Delphi code is
a no-brainer. Who knows, you might start answering more questions on this
group than Bill Todd :)

Good luck,
krf




"Bpk. Adi Wira Kusuma" <adi_wira_kusuma (AT) yahoo (DOT) com.sg> wrote

Quote:
my table (TADOTable) has been active. Then I execute SQL at TADOQuery,
which
its contents:

Insert into ....................

After success, I call "Refresh" method at TADOTable. but I cannot see new
record at DBGrid.

//================

ADOTable1.Open;
ADOQuery1.ExecSQL; // execute "Insert Into............
ADOTable1.Refresh;
// Why Can I not see the changing record?





Back to top
Bpk. Adi Wira Kusuma
Guest





PostPosted: Fri Apr 15, 2005 1:51 am    Post subject: Re: Why Does "Seek" method not work? Reply with quote

thanks of your support.


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) 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.