Link to home
Create AccountLog in
Avatar of Grant1842
Grant1842Flag for United States of America

asked on

How to update 1 access database shared by 5 people

I have an access database storing info for my dayplanner application

I am using 5 exes(5 People) and  pointing to 1 access database.

I need to sync up what each of the useres do so all 5 users can see what each other is scheduling.

I am using
EventsDataSourc and
EventsTable.

I am trying the code below to update and refresh but not working.
procedure TDataModule2.EventsTableAfterPost(DataSet: TDataSet);
begin
eventstable.Edit;
eventstable.UpdateRecord;
eventstable.Refresh;
end;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of systan
systan
Flag of Philippines image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Grant1842

ASKER

THanks systan for the info on the .dsn file but I all ready use a dat fille to store the connection string and such.

My problem is i can not get my info to Reload, Refresh and sync up so each user can see who is scheduleing what.

My error is in th image .
error is:= Row can not be located for updating Some values may have been changed since it was read.
error2.JPG
Systan will thsi DSN method sync up my info ?
Avatar of jimyX
jimyX

I tried to generate this error and I succeeded. I have created two applications with timers, one sets some records in the DB to a certain values and the other one sets it back and then I got that error "Row cannot be located for updating..."

Do you have a unique  index column? Because what I did to fix that was creating an AutoNumber column to be able to distinguish the different records since my records have similar values, i.e. some rows have identical values and maybe it's you case here.
>>will thsi DSN method sync up my info ?
Very sure of that, if your using ms_access database
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Jimmyx
The the ID column is AutoNumber
Systan I am using an tDatasource and TadoTable.

I am haveing trouble with writeing code for the Connection1.FileDSN .
I can not find a FileDsn property for either one of these.
iyerbh
 That article is for using access by its self .
I am doing this in Delphi.
Thaks for your link anyway.
I am using Delphi 2010 and devExpress cxScheduler1 component.
Here is the source I am working with.

www.eclintwood.com/dbTest.zip
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks jimmyx , but i am trying this on before and after events of the edit and post and and no luck.
Disable the lines in the EventsTableAfterPost and try, that should work.

procedure TDataModule2.EventsTableAfterPost(DataSet: TDataSet);
begin
  //eventstable.Edit;
  //eventstable.UpdateRecord;
  //eventstable.Refresh;
end;

Open in new window

SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account