Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Below code is placed in menu.when I

Status
Not open for further replies.

arunrote

Programmer
Oct 10, 2001
6
IN
Below code is placed in menu.when I run application we have an option to open table from menu in which we can view & edit records.For first time table is opening fine and it is working.we also perform other task by using this table
in different forms.But when we again try to open same table,an error"File Access Denied" occurs.Can u provide me a solution






ON ERROR DO errhand2 WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
CLOSE DATABASES
OPEN DATABASE (home(2)+'data1')
USE mode
BROWSE FIELDS mode NODELETE valid :F !EMPTY(mode) ERROR MESSAGEBOX('Enter Some value')

PROCEDURE errhand2
PARAMETER merror, mess, mess1, mprog, mlineno
CLEAR
messagebox('Error number: ' + LTRIM(STR(merror)))
messagebox('Error message: ' + mess)
messagebox('Line of code with error: ' + mess1)
messagebox('Line number of error: ' + LTRIM(STR(mlineno)))
messagebox('Program with error: ' + mprog)
endproc
 
You have probably opened the table exclusively.

You should either open all tables shared

USE myTable IN 0 SHARED

or issue SET EXCLUSIVE OFF at the start of your program and when you issue:

USE myTable IN 0 it will be opened shared by default.

HTH,
Weedz (Wietze Veld)
My private project:Download the CrownBase source code !!
 
Hi
In Addition to what WEEDZ mentioned...

If the code is refined.. as given below... it could help
**********************************************
ON ERROR DO errhand2 WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
CLOSE DATABASES
OPEN DATABASE (home(2)+'data1')
[COLOR=/blue]
SELECT 0 [COLOR=/]
USE mode [COLOR=/blue] AGAIN SHARED [COLOR=/]
BROWSE FIELDS mode NODELETE valid :F !EMPTY(mode) ERROR MESSAGEBOX('Enter Some value')
[COLOR=/blue]
USE
[COLOR=/]
PROCEDURE errhand2
PARAMETER merror, mess, mess1, mprog, mlineno
CLEAR
messagebox('Error number: ' + LTRIM(STR(merror)))
messagebox('Error message: ' + mess)
messagebox('Line of code with error: ' + mess1)
messagebox('Line number of error: ' + LTRIM(STR(mlineno)))
messagebox('Program with error: ' + mprog)
endproc
***********************************
Also I suggest you dont use file names with protected words or like words which could confuse you or the programe on a later date. MODE is a common coputer word used for manyting. Using it as a file name will lead to confusion.
Example....
SELECT * FROM file ;
GROUP BY group ;
ORDER by order ... etc... where 'file' is the data file, group, order are fields in that...

Hope this helps :)
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top