Page 1 of 1

MyTable Refresh Problems

Posted: Tue 27 Nov 2007 11:43
by Simon180
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

Posted: Tue 27 Nov 2007 13:26
by Antaeus
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.

..

Posted: Tue 27 Nov 2007 13:48
by Simon180
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

Posted: Tue 27 Nov 2007 14:15
by Antaeus
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.