>I get the error - Class is not a variable. Here's how I get there. I find a form name in a table because I want to open the form.scx as a table. I am having trouble SELECTing the form name which is the table name after I do the USE command to open the table which is really my form.scx file. Right now, the SELECT is not in the code, hence the error message. What am I doing wrong? What should the SELECT command look like? I have tried several variations, but no luck. Thanks for the help.
>
>Here's my code -
>
>IF !USED('app_frms')
> USE c:\datadict\app_frms IN 0 SHARED
>ENDIF
>
>SELECT app_frms
>pathname = app_frms.frm_drive+":\"+ALLT(app_frms.frm_dir)+"\"+ALLT(app_frms.frm_name)+".SCX"
>IF FILE(pathname)
><b> path_name = app_frms.frm_drive+":\"+ALLT(app_frms.frm_dir)+"\"+ALLT(app_frms.frm_name)</b>
> USE &path_name
>
Just in case nobody noticed so far, you're missing the +".SCX" in the bolded line, so your path_name has a filename without an extension. Therefore the "USE &path_name && IN 0 SHARED" tries to open a file with a default extension of .dbf, which is most probably not there.
BTW, why did you split the pathnames into three parts? I usually have them in memo fields; nowadays they can be rather long, specially with UNCs. Besides, the "drive" part of an UNC may have substantial length.
But then it's a different matter, which would deserve a separate thread or a quick poll by Michel: mapped drives or UNCs, pros and cons.