Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing datasession or SET('DATABASE') to other form
Message
From
15/02/1999 17:56:28
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00187750
Message ID:
00187853
Views:
25
Unless I'm not understanding this either, you're using something like DBGETPROP to get captions from the database. Tables can be opened (in the DE or elsewhere) without their database being the active one. You seem to have to choices:

SET DATABASE TO (mydatabase) before running the form, or

pass the database name to the form, a la DO FORM (myform) WITH (mydatabasename)

Then in the Init of the form,

LPARAMETERS cDataBase
SET DATABASE TO &cDatabase

Assuming of course that the database is at least open.

Is this your question?

>That was quick.
>
>I'm still stumped, but I'll re-iterate the clues: the error indicates that I need to SET DATABASE TO something. However, in the calling form, the DBC() function returns an empty string, so I can't pass the name of the database to the search class. I should also mention that I am using vfp6 and that my forms were converted from vfp3.
>
>My short-term stop-gap measure is to disable the code that gets caption names when the calling form has a private datasession. But I don't want to leave it like that.
>
>>Sorry, Bret.
>>
>>I meant set the form property called that is called DataSession to 1)-Default Data Session. Which apparently you have done.
>>
>>Then, if your private form calls the search form, the search form will use the datasession from the private form by default.
>>
>>If you are not seeing it...then there is something else wrong. (At least as far as I can tell.)
>>
>>>I'm not sure what you mean by "set the default datasession to default". The .DataSession property of my search form class is 1 - default.
Eric Shaneson
Cutting Edge Consulting
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform