| View previous topic :: View next topic |
| Author |
Message |
Bpk. Adi Wira Kusuma Guest
|
Posted: Mon Apr 11, 2005 6:39 pm Post subject: Why Does "Seek" method not work? |
|
|
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
|
Posted: Tue Apr 12, 2005 5:28 pm Post subject: Re: Why Does "Seek" method not work? |
|
|
"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
|
Posted: Thu Apr 14, 2005 1:54 am Post subject: Re: Why Does "Seek" method not work? |
|
|
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
|
Posted: Thu Apr 14, 2005 12:45 pm Post subject: Re: Why Does "Seek" method not work? |
|
|
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
|
Posted: Fri Apr 15, 2005 1:51 am Post subject: Re: Why Does "Seek" method not work? |
|
|
thanks of your support.
|
|
| Back to top |
|
 |
|