Hello all!
I'm using remote views to hit SQL server data from my VFP 7.0 app. Once
I set the parameter, the remote view is retrieved just fine, but when
the parameter changes and I requery the remote view, it doesn't refresh.
It sticks with the old parameter.
I've been able to rig it by closing the remote view and reopening
everytime the parameter changes but that's a pain.
Any ideas on why it's not refreshing?
Thank you!
Amanda
On Mar 1, 2005, at 8:54 AM, Amanda Brown wrote:
> Hello all!
>
> I'm using remote views to hit SQL server data from my VFP 7.0 app. Once
> I set the parameter, the remote view is retrieved just fine, but when
> the parameter changes and I requery the remote view, it doesn't
> refresh.
> It sticks with the old parameter.
Is this occurring on only one remote view out of many? Try to create
another view and see if you see the same problem. Perhaps there's a
simple error like a mis-named parameter or a fieldname the same as the
variable name (the fieldname would take precedence). Can you post some
simple code that shows this problem?
If that doesn't isolate the problem, most likely, there is a setting
altered from the default that is causing your new request not to be
seen by the server. This is usually defined at the connection level and
not for an individual view. Can you run GenDBC (located in
home()+"\tools\gendbc" and post the code that defines the connection
and the remote view and sets all of their properties?
Ted Roche
Ted Roche & Associates, LLC
Author: Vince Teachout
Posted: 2005-03-01 11:14:37 Link
At 08:54 AM 3/1/2005 -0500, Amanda Brown wrote:
>I'm using remote views to hit SQL server data from my VFP 7.0 app. Once
>I set the parameter, the remote view is retrieved just fine, but when
>the parameter changes and I requery the remote view, it doesn't refresh.
>It sticks with the old parameter.
>
>I've been able to rig it by closing the remote view and reopening
>everytime the parameter changes but that's a pain.
>
>Any ideas on why it's not refreshing?
Assuming there isn't a typo in the view parm (ie, vMyParm is set, but
vMyPorm is changed), the only thing I can think of off the top of my head
is that the view isn't in the current work area and you are issuing
requery with no parm:
like this:
* amazing code here
requery()
instead of this:
* amazing code here
Select MyView
Requery()
or this:
* amazing code here
Requery("MyView")
HTH.
How is your view parameter referenced in your remote view? It should be
preceded by a ?. Something like this:
SELECT fields FROM table WHERE pkey = ( ?m.pkey )
If it isn't, then the parameter only gets evaluated the first time the
view is executed.
> At 08:54 AM 3/1/2005 -0500, Amanda Brown wrote:
>
> >I'm using remote views to hit SQL server data from my VFP 7.0 app. Once
> >I set the parameter, the remote view is retrieved just fine, but when
> >the parameter changes and I requery the remote view, it doesn't refresh.
> >It sticks with the old parameter.
> >
> >I've been able to rig it by closing the remote view and reopening
> >everytime the parameter changes but that's a pain.
> >
> >Any ideas on why it's not refreshing?
>
>
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------
Thanks for the reply!
It was all views but we figured it out. I was setting the parameter to
fieldname in the view but the application was referencing it as
m.fieldname. Once I changed the view parameters to m.fieldname, they all
worked. Can't say I entirely undertstand the m. problem but it did solve
it.
Thanks!!
>>> tedroche@tedroche.com 3/1/2005 10:26:09 AM >>>
On Mar 1, 2005, at 8:54 AM, Amanda Brown wrote:
> Hello all!
>
> I'm using remote views to hit SQL server data from my VFP 7.0 app.
Once
> I set the parameter, the remote view is retrieved just fine, but
when
> the parameter changes and I requery the remote view, it doesn't
> refresh.
> It sticks with the old parameter.
Is this occurring on only one remote view out of many? Try to create
another view and see if you see the same problem. Perhaps there's a
simple error like a mis-named parameter or a fieldname the same as the
variable name (the fieldname would take precedence). Can you post some
simple code that shows this problem?
If that doesn't isolate the problem, most likely, there is a setting
altered from the default that is causing your new request not to be
seen by the server. This is usually defined at the connection level and
not for an individual view. Can you run GenDBC (located in
home()+"\tools\gendbc" and post the code that defines the connection
and the remote view and sets all of their properties?
Ted Roche
Ted Roche & Associates, LLC
[excessive quoting removed by server]
That's what I had except I forgot the m.!
>>> richard@rfcsystems.com 3/1/2005 11:38:11 AM >>>
How is your view parameter referenced in your remote view? It should be
preceded by a ?. Something like this:
SELECT fields FROM table WHERE pkey = ( ?m.pkey )
If it isn't, then the parameter only gets evaluated the first time the
view is executed.
> At 08:54 AM 3/1/2005 -0500, Amanda Brown wrote:
>
> >I'm using remote views to hit SQL server data from my VFP 7.0 app.
Once
> >I set the parameter, the remote view is retrieved just fine, but
when
> >the parameter changes and I requery the remote view, it doesn't
refresh.
> >It sticks with the old parameter.
> >
> >I've been able to rig it by closing the remote view and reopening
> >everytime the parameter changes but that's a pain.
> >
> >Any ideas on why it's not refreshing?
>
>
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------
[excessive quoting removed by server]
This is why it's good practice to not use the same name for a variable
and a field as VFP will always pick up the field before a memvar. And
that bad practice is illustrated in my example below... Oops... Glad you
got the problem solved
Amanda Brown wrote:
>That's what I had except I forgot the m.!
>
>
>
>>>>richard@rfcsystems.com 3/1/2005 11:38:11 AM >>>
>>>>
>>>>
>How is your view parameter referenced in your remote view? It should be
>
>preceded by a ?. Something like this:
>
>SELECT fields FROM table WHERE pkey = ( ?m.pkey )
>
>If it isn't, then the parameter only gets evaluated the first time the
>
>view is executed.
>
>
--
Richard Kaye
RFC Systems
Voice: 973.761.0868
Fax: 973.761.4329
For the fastest response time, please send your tech support
queries to techsupport@rfcsystems.com
---------------------------------------------------------
---------------------------------------------------------
Author: MB Software Solutions
Posted: 2005-03-02 08:55:29 Link
Richard Kaye wrote:
> This is why it's good practice to not use the same name for a variable
> and a field as VFP will always pick up the field before a memvar. And
> that bad practice is illustrated in my example below... Oops... Glad
> you got the problem solved
>
Hence my affection for using tiKey as it clearly tells the developer
that it's a parm, not a field, simply by the way it's coded.
--Michael