Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The best way to insert a record in Multi-user environmen
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00918800
Message ID:
00918807
Vues:
13
Dawa,

Is the Windows 2000 "server" actually the server version of the OS or the PRO version? If the pro version then I believe that the max. simultaneous 'share' count is 10 and that might have some impact.

Is this a form, and are you using private datasessions. If yes to both (and maybe even if not, especially considering the COMponent) have you ceded an explicit SET EXCLUSIVE OFF? Possibly you are defaulting to ON.

good luck



>Hello All,
>
>I have a multi-user vfp application in the following architecture:
>
>- The database resides on drive c: of a server (Window 2000) ;
>- VFP applications are installed on the workstations (about 30 workstations) which are connected to the server.
>- The app opens the database through a mapped drive to access the database
>- I also have foxisapi installed on the server and internet users are accessing the database through a COM component I created in VFP.
>
>My problem is that users are getting error 108 ("File in use by another user") because when they try to add a new record.
>
>I have devloped couple approaches:
>
>First one:
>
>  set reprocess to automatic
>  public _gaerror(1,7)
>  on error aerror(m._gaerror)
>  use table1 shared
>  cursorsetprop('buffering',1) && no buffering
>  local i
>  for i = 1 to 1
>    m._gaerror = 0
>    if rlock('0','table1') ;
>    then
>      insert into table1 ;
>        (field1) values (m.lnValue)
>      unlock record 0 in table1
>    else
>      if m._gaerror(1,1)=108 ; && If the file is locked by another user try again
>      then
>        i = i - 1 && keep trying till succed
>      endif
>    endif
>  next
>  use in table1
>
>
>Second one:
>
>  set multilocks on
>  set reprocess to 1 && try locking once
>  sys(3051,500) && try at every 500 miliseconds
>  sys(3052,1,.t.) && index locking honors reprocess setting
>  sys(3052,1,.t.) && memo locking honors reprocess setting
>  public _gaerror(1,7)
>  on error aerror(m._gaerror)
>  use table1 shared
>  cursorsetprop('buffering',3) && optimistic row buffering
>  insert into table1 ;
>    (field1) values (m.lnValue)
>  local i
>  for i = 1 to 1
>    m._gaerror = 0
>    if not tableupdate(2,.t.,'table1') and ;
>      m._gaerror(1,1)=108 ; && If the file is locked by another user try again
>    then
>      i = i - 1 && keep trying till succed
>    endif
>  next
>  use in table1
>
>
>Theoretically, as long as table1 was not opened exclusively by another user this should work. But in reality, it doesn't seem to do the trick.
>
>Is there a third approach that grantees the record inserting?
>
>Any help will be greatly appreciated!
>
>Dawa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform