Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Alias cannot be found when using views
Message
De
18/06/2002 10:20:28
Angela Haws
Seminole County Tax Collector
Debary, Floride, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Alias cannot be found when using views
Divers
Thread ID:
00669725
Message ID:
00669725
Vues:
44
Hello all! I've begun getting my hands dirty with views since I've taken an advanced VFP course in April. I have been successful with them until now....
Here's the breakdown:
1. I have a FORM frmOccData that takes a parameter, an account number.
2. It also contains a simple navigation button set.(and of course, several textboxes)
3. It contains a view, 'VOwner' which is placed inside my .dbc and I have NoDataOnLoad set to .t. for that cursor.
The view 'VOwner' is not updateable, and is parameterized.

In the INIT of frmOccData:

Lparameter lc_custID
OPEN DATABASE Occdata.dbc
requery('VOwner')
thisform.refresh()

The above works great! The owner info is correct and all is well.

HOWEVER, there could be more than one owner, so I set a form variable "ViewCount" = to reccount() of the view, and if the form variable > 1, the navigation button set becomes visible. I checked an account that has 2 owners and it shows "2" in the textbox that has the controlsource set to thisform.viewcount. The navSet is located just below this textbox.

Behind the nav set:

select vOwner
if !eof()
skip
else
messagebox("End of file")
endif(this is for next, and !bof for previous)

When I select 'VOwner', that is where I get the 'alias not found' error.

Then behind the navbutton I tried:

OPEN DATABASE Occdata ( I tried not opening and opening this- and both did not work)
lc_Custid = thisform.custnum (This holds the account number since I declared it in the init of the form)
requery('Vowner')
thisform.refresh()


When I try to requery, it says "Alias VOwner not found"!
I thought that it could be something that was inside the NavButton class, but I placed a command button and put the same code as the 'Next' in the NAvSet, and received the same errors....

It seems like the dataenvironment is losing the pointer to the view...
Can someone point me in the right direction?

Also, how can I reference the dataenvironment from the form to set Nodataonload = .t. for a cursor that I may have to open again programatically?


Thanks in advance
Angie
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform