|
Home > Archive > Programming with dBASE > June 2005 > Changing Alias at design time
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Changing Alias at design time
|
|
| John Noble 2005-06-17, 8:23 pm |
| A long time ago I created a form, dragged on some queries that were linked to a database object through using a BDE alias.
Unfortunately, I now need to change the the database object that some of the queries are pointing to. However, my attempts to change this have not been successful.
I have tried simply using the inspector and editing the construction code of the queries. Although I can recomplie the form, when I run it begins to produce a string of 'Invalid Subscript errors' even though I know that the fields in question do exists.
I tried deleting the current queries and dragging new ones on from the correct alias again without success as all of the controls that were linked to the deleted query refuse to work with the new query even though the queries shared the same name.
Most of the controls on the form including a grid are datalinked to one of the queries that I want to change, so I am not particularly keen on starting a new form from scratch.
Any advice welcome,
John
| |
| Frank J. Polan 2005-06-17, 8:23 pm |
| John,
The only possible change to a database object that I can see is the
Alias
If that's the case, in the Source Editor - not the designer, change
the database objects alias name to the new alias.
If I've misunderstood can you give more details
Frank Polan.
On Fri, 17 Jun 2005 17:41:20 -0400, John Noble <john@nor-tech.co.uk>
wrote:
>A long time ago I created a form, dragged on some queries that were linked to a database object through using a BDE alias.
>
>Unfortunately, I now need to change the the database object that some of the queries are pointing to. However, my attempts to change this have not been successful.
>
>I have tried simply using the inspector and editing the construction code of the queries. Although I can recomplie the form, when I run it begins to produce a string of 'Invalid Subscript errors' even though I know that the fields in question do exists.
>
>I tried deleting the current queries and dragging new ones on from the correct alias again without success as all of the controls that were linked to the deleted query refuse to work with the new query even though the queries shared the same name.
>
>Most of the controls on the form including a grid are datalinked to one of the queries that I want to change, so I am not particularly keen on starting a new form from scratch.
>
>Any advice welcome,
>
>John
| |
| John Noble 2005-06-18, 3:23 am |
|
>
> The only possible change to a database object that I can see is the
> Alias
>
> If that's the case, in the Source Editor - not the designer, change
> the database objects alias name to the new alias.
I need to keep the original database object as some queries need it.
Although I think I may have solved the problem - I copied the existing code from the form, created a new blank form, pasted the code on to the new form, added the required database object within the source code and then finnaly changed the database proper
ty of some of the queries again directly in the source code. Seems to be working fine.
Although I cant understand why the just editing the source code in the original form doesn't work.
Thanks for your help Frank,
John
| |
| Robert Bravery 2005-06-19, 3:23 am |
| Hi John,
Why do you have to change the database alias. Did you create a new one, why
not just point the old one to the new data folder.
Anywahy, changing the alias should not give you that much problems. You
don't need to change the queryobject at all. All you have to do is change
the databasename property of the database object. save and recompile. You
would have to do this wherever the database object is listed in your code
Robert
|
|
|
|
|