Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Data Table Location of a View
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00147871
Message ID:
00148044
Views:
26
>>>I am using a view in a form: v_test
>>>The view is a local view in a dbc called: test
>>>The table is called test.dbf and is in a folder called c:\test\01
>>>
>>>So the SQL for the view is:
>>> SELECT * FROM test!test
>>>
>>>I want to be able to use the same view against the same table located in folder c:\test\02. In other words, multiple sets of data.
>>>
>>>The cursorsource of the DE is v_test.
>>>
>>>How do I change the table location in the DBC to be:
>>> c:\test\02 instead of c:\test\01
>>>
>>>Any ideas?
>>
>>AFAIK, you cannot do this using the same view. You probably want to create a second view pointing at the second set of data...
>>
>>but perhaps I could use a little more background on why you are trying to do this...
>
>
>Erik:
>
>It is an accounting system.
>Each folder would be the books for a different company.
>I want to use remote views for the connection to SQL Server.
>I want to use local views for Fox.
>I want to be able to use the same forms for connecting to both SQL and Fox.
>
>The database tables would be identical in Fox, just stored in different folders.

I would suggest you have two dbc's, one for the SQL Server remote views and one for VFP local views...keeping in mind that the views are part of the dbc and not separate files as are tables. Give the views the same name regardless of the dbc they are in, that way your controlsources will work.

So then all you need do is open the dbc you want and whala...you have an app that can *swing both ways* :)

And, BTW, I would suggest combining all like tables you seem to want to separate by company into one table using a unique, internal, indexed COMPNO and let your parameterized views / SELECT statments sort things out.
Ken Sorce
Team RAD, Inc.
Rapid Application Developers
Ken@TeamRAD.com
www.teamrad.com
Previous
Reply
Map
View

Click here to load this message in the networking platform