Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assigning a connection name on the fly
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00451337
Message ID:
00451359
Views:
21
>I am connecting to an Access database through ODBC. I have remote views setup inside a standard VFP database.
>
>My question is, is there a way to change the connect name on the fly. There doesn't appear to be a way to to this as the name is stored in the DBC and the 'ConnectName' option within dbsetprop() is a read-only property.
>

Nope, you have to redefine the view to change the connection. FWIW, the USE command in VFP7 has an optional clause that lets you define which connection to use when opening the view.

If you decide to redefine the entire view on the fly, you might want to check out EView here in the files section- it will generate code from your view that can be used to recreate the view. You could even modify that code to take a parameter for the connection to use. Be aware that redefining a view on a regular basis will contribute to DBC bloat.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform