Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Patrick Dowd
  Where is Patrick Dowd?
 
 California - United States
 Patrick Dowd
 To: john satellite
  Where is john satellite?
 zj
 China
 john satellite
 Tags
Subject: RE: invalid database table name ?
Thread ID: 16068 Message ID: 16071 # Views: 0 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Tuesday, October 08, 2002 8:40:31 PM         
   


> Hi, Experts:
> Please tell me the error in the code below(system error is "Invalid database table name")
> mypath=ALLTRIM(SYS(5)+SYS(2003))
> SELECT menulist
> LOCATE FOR ALLTRIM(mname)==ALLTRIM(thisform.combo1.DisplayValue)
> sysnum=ALLTRIM(STR(mnum))
> topath=STUFF(thisform.text1.Value,LEN(ALLTRIM(thisform.text1.Value)),1,'')
> filename_1='dbs_&sysnum'+'.dbf'
> filename_2='dbs_&sysnum'+'.fpt'
> filename_3='setface_&sysnum'+'.dbf'
> filename_4='calc_&sysnum'+'.dbf'
> FOR n=1 TO 4
> nn=ALLTRIM(STR(n))
> IF FILE('&topath\&filename_&nn')
> ===> REMOVE TABLE &mypath\dbf\&filename_&nn
> COPY FILE &topath\&filename_&nn TO &mypath\dbf\&filename_&nn
> ADD TABLE &mypath\dbf\&filename_&nn
> ENDIF
> ENDFOR
>
> Thanks
> John Satellite

John,

Probably the easiest thing to do is to step through the code to see where it blows up and then examine the contents of your memvars. You will probably spot the invalid file name immediately and be able to correct your code accordingly.

Patrick



ENTIRE THREAD

invalid database table name ? Posted by john satellite @ 10/8/2002 6:50:33 PM
RE: invalid database table name ? Posted by Patrick Dowd @ 10/8/2002 8:40:31 PM