I am using vfp 8.

I have a form with a parametric view called vtopic in the data environment.

I have set:
Dataenvironment.AutoOpenTables = .F.
Cursor1.NoDataOnLoad = .T.

On the form there is a grid with recordsource = vtopic and recordsourcetype
= 1 - Alias.

Two comboboxes determines the parametric value of the view. When the
comboxes undergo InteractiveChange a method is called up to calculate the
parameter and update the grid:

* thisform.updategrd()
MESSAGEBOX(thisform.grd1.RecordSource) && displays 'vtopic' as it should
select topic_key From topiclist Where subject_key =
Val(Thisform.cmbsubject.Value) ;
AND grade_key = Val(Thisform.cmbgrade.Value) Into Array la
If _Tally = 0 Then
DIMENSION la(1)
la = 0
ENDIF
REQUERY(thisform.grd1.RecordSource) ***
Thisform.grd1.Refresh

This is the view:

SELECT Topic.key, Topic.topic;
FROM ;
topic;
WHERE ASCAN(?la,key) > ( 0 );
ORDER BY Topic.topic

When I run the form I get the error message 'Alias not found' in the line
marked with *** above.

The form uses private data session.

Any help is greatly appreciated.

One more thing. I want to use optimistic table buffering, so in the forms
init method I have:
SET MULTILOCKS ON
=CURSORSETPROP("Buffering", 5) && optimistic table buffering

Is this the way to do it?

Sincerely,

Jan Nordgreen

Re: 'Alias not found' in requery of parametric view. by Rush

Rush
Sat Nov 22 10:15:33 CST 2003

First, try:

REQUERY('vtopic')

If that works, try:

LOCAL cView
cView = thisform.grd1.RecordSource
REQUERY(cView)

Sometimes you need to use memvars instead of properties.

- Rush

"Jan Nordgreen" <room23111@REMOVETHIShotmail.com> wrote in message
news:ufhG%23wQsDHA.1088@tk2msftngp13.phx.gbl...
> I am using vfp 8.
>
> I have a form with a parametric view called vtopic in the data
environment.
>
> I have set:
> Dataenvironment.AutoOpenTables = .F.
> Cursor1.NoDataOnLoad = .T.
>
> On the form there is a grid with recordsource = vtopic and
recordsourcetype
> = 1 - Alias.
>
> Two comboboxes determines the parametric value of the view. When the
> comboxes undergo InteractiveChange a method is called up to calculate the
> parameter and update the grid:
>
> * thisform.updategrd()
> MESSAGEBOX(thisform.grd1.RecordSource) && displays 'vtopic' as it should
> select topic_key From topiclist Where subject_key =
> Val(Thisform.cmbsubject.Value) ;
> AND grade_key = Val(Thisform.cmbgrade.Value) Into Array la
> If _Tally = 0 Then
> DIMENSION la(1)
> la = 0
> ENDIF
> REQUERY(thisform.grd1.RecordSource) ***
> Thisform.grd1.Refresh
>
> This is the view:
>
> SELECT Topic.key, Topic.topic;
> FROM ;
> topic;
> WHERE ASCAN(?la,key) > ( 0 );
> ORDER BY Topic.topic
>
> When I run the form I get the error message 'Alias not found' in the line
> marked with *** above.
>
> The form uses private data session.
>
> Any help is greatly appreciated.
>
> One more thing. I want to use optimistic table buffering, so in the forms
> init method I have:
> SET MULTILOCKS ON
> =CURSORSETPROP("Buffering", 5) && optimistic table buffering
>
> Is this the way to do it?
>
> Sincerely,
>
> Jan Nordgreen
>
>



Re: 'Alias not found' in requery of parametric view. by Jan

Jan
Sat Nov 22 17:14:22 CST 2003

Rush,

I tried both:

REQUERY('vtopic')

and

LOCAL cView
cView = thisform.grd1.RecordSource
REQUERY(cView)

None of them work!

Jan



Re: 'Alias not found' in requery of parametric view. by rjc36

rjc36
Thu Nov 27 10:46:15 CST 2003

Jan,

I believe the problem is that your grid object can not be instantiated
without it's recordsource being a valid alias (at that time). Object
creation occurs following the form load method. This is when the
alias must exist. You can remedy the situation by setting the
DataEnvironment.AutoOpenTables = .T. and DataEnvironment.OpenViews = 0
or 1 or 2 (depending on view location). Cursor1.NoDataOnLoad can
remain True and Buffering can be set from the DataEnvironment too. I
hope this helps.

Rob