MyTable Refresh Problems

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Simon180
Posts: 3
Joined: Fri 13 Apr 2007 14:16

MyTable Refresh Problems

Post by Simon180 » Tue 27 Nov 2007 11:43

I making a chat appliction and am using mydacs as my main sql core the problem am having is when a user submits a new account from my website my server dont pick up the needed information so when there login it says there account was not found.

so i added a refresh funcation so everytime sumone logins in the client sends a refresh command to the server to auto update all useraccounts via mytable

like so

if (com = 'ReloadDB') then
begin
UsersTable.Refresh;
end;

however this makes my server very unstable and crashing it out if i remove the refresh my server works fine is there abetter way of refreshing the full user db so my server can pick up all new accounts?

thanks

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 27 Nov 2007 13:26

It is better to use the RefreshQuick method in this case. It refreshes only modified records. If there were no significant changes in the table, RefreshQuick works much quicker than Refresh, and saves traffic.

Simon180
Posts: 3
Joined: Fri 13 Apr 2007 14:16

..

Post by Simon180 » Tue 27 Nov 2007 13:48

problem is am using a php web register script that adds the account to the sql database its then I have the problem because the server software dont see the new account untill its been fully refreshed

if (com = 'ReloadDB') then
begin
UsersTable.RefreshQuick(false);
end;

with no luck it still did not refresh to allow the new account to login

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 27 Nov 2007 14:15

RefreshQuick requires a primary key and a TIMESTAMP field in the table. Do you have them? Are there any errors raised when you call RefreshQuick?
Is a query like the one below sent to the server when you call RefreshQuick?

Code: Select all

SELECT * FROM table_with_timestamp
WHERE timestamp_fld >= '2007-11-11 00:00:00'
Try to check record count in your table before and after RefreshQuick.

Post Reply