Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alias switching
Message
From
24/03/2004 08:43:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00888287
Message ID:
00889207
Views:
18
Hi John

I have not tested this but I would try something like this: Instead of setting the alias of the file in the form to a hard coded value store the alias in a variable (or form property). Then set this variable to the required file name depending on what file you are working with. If all references are via the form alias variable/property then you can dynamically change the value of the variable to access the different files.

For instance:
USE test1 IN 0 
USE test2 IN 0

cAlias = "test1"
? &cAlias->xfield  &&  shows contents of xfield in file test1

cAlias = "test2"
? &cAlias->xfield  &&  same line as above but shows contents of xfield in test2
>Hi,
>
>I want to open 4 tables that are identical is structure, same name except for a numeric trailer (e.g. test1.dbf, test2.dbf, test3.dbf, test4.dbf). I would like to open them all at once at the beginning of the application, but refer to them from a form with a single alias name.
>
>For example, a form has it's controlsource for it's fields tied to the alias "test". When I open "test1", I will set it's alias to "test". When I navigate to the end of table "test1" on the form, I want to switch the alias name "test" to now refer to table "test2", and the form will begin displaying records from "test2".
>
>The reason for this is that the records in a particular table has reached the VFP limit and we needed to break the records apart into separate tables. Now I would like to make it act like a single table by switching from table to table dynamically and seamlessly, so the user doesn't know it is happening.
>
>Any ideas on how to accomplish this?
>
>Regards,
>
>John
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform