Hi,
I think you should have sent this to Jan ?????
>>Hi,
>>Check that the read only attributes aren't set on the exe or the data files.
>
>
>>>ei!!! peace!!!
>>>
>>>i shared my program into a network, and it cannot access if another user using it. give me some tips on how to share it in multiuser and some sample codes on how to add new record or update a record in a network....
>>>
>>>thanks!!!
>
>If a single user can update or insert a new record to your data
>it means you created a single user.
>
>You have to make it sure that you issue some commands using
SET:
>
>
Set Exclusive off
>If your tables are part of a DATABASE Container, be sure to open your
>database in shared mode.
>
>You can issue the command :
>
OPEN DATA <I>your_database_name</I> shared
>
>This commands depends if you manually loading your data from your forms
>
Load Event Procedure>
>On My case, I Manually load my DATABASE and its table manually form by
form instead of opening on my main programs(prg..) like this:
>
I Mostly put under
LOAD Procedure of my forms..
>
IF !DBUSED("MY_DATABASE_NAME")
> OPEN DATA DATA\MY_DATABASE_NAME SHARED
> ENDIF
> */* Open a table
> If USED("Customers")
> Select("Customers")
> Set Order to Tag "my_tag_name"
> ELSE
> Use customers in 0 order tag "my_tag_name" shared
> ENDIF
> SELECT("CUSTOMERS")
> GO TOP
>
>Adding new Record, u can use Insert command, or append blank
>
Note: I used 3 Field on my sample, add according to your table fields.
>
SELECT("CUSTOMERS")
>APPEND BLANK
>IF !ISRLOCKED()
> RLOCK()
> REPLACE FIELD_NAME1 WITH cVar1,;
> FIELD_NAME2 WITH cVar2,;
> FIELD_NAME3 WITH cVAR3
> UNLOCK
>ENDIF
>OR
LOCK the record when you just appended a blank record.
>You can LOCK the Whole Table if you prepare 1 user appending records at a time by issueing the command
FLOCK, but dont forget to
UNLOCK it to give access to other user.
>
>Updating of Records,
>
>You can use Update Into commands, or just use the replace command..
>
SELECT("CUSTOMERS")
>IF RLOCK()
> REPLACE FIELD_NAME1 WITH cVar1,;
> FIELD_NAME2 WITH cVar2,;
> FIELD_NAME3 WITH cVAR3
> UNLOCK
>ELSE
>
>
>
>ENDIF
>
>Hope you can get some a TIP... There's a lot of command you can use.. check on your VFP Help System and look for
record locking.
>
>By the way, if you Issue a record LOCK or FILE LOCK without unlocking can cause the message
File in use/access denied.
Regards N Mc Donald