Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a better way to do this?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00162439
Message ID:
00162440
Views:
24
>I get a DB/table name to open from another DB/table full of DB/table names.
>
>Code looks something like this:
>
>dbnam = mydb.dbnames && Get DB name from list of DB names
>SELECT &dbnam && Select DB/table that came from list
>SEEKID = &dbnam.field1 && Get Seek ID value
>SEEK SEEKID && Seek the record
>IF FOUND()
> .....
> .....
>ENDIF
>
>But whenever I run the program and it encounters the SEEKID =
>&dbnam.field1 command, I get an error that &dbnam is not an object. I thought I had used a Macro substitution in the past just like this without error. Any ideas? Is there a better way to do it?
>
>I have read that one may use SELECT (dbnam) instead, but I get the same error, but better performance? Thanks.

Try:

dbnam = trim(mydb.dbnames
select 0
use (dbnam)
seekid = &dbnam..field1
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform