Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding and removing a class based object
Message
From
10/10/2002 11:20:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00709847
Message ID:
00709857
Views:
18
This message has been marked as the solution to the initial question of the thread.
>I am using the sfquery.vcx class to create a filter on my data. Right now I just drop the sfquery.vcx onto the form and call it. The problem is it doesn't refresh it's fields listing if the data environment changes underneth it (I use sql2000 for the backend and no matter what query the user select, it assigns it to the same cursor name sqlresult). So to reset the filter, currently the user has to close the form and reopen it. I was thinking that if I added the sfquery with code, then I could drop it and readd it each time they pressed the filter button and it would hopefully reset.
>
>From the command window I can create the object using:
>
>oQuery=NewObject("sfquery","c:\ctsql\stone\sfquery\sfquery.vcx")
>
>But I'm not sure how to do this from within the form so it becomes an object of the form.
>
>Any help appreciated.
>
>Kirk

thisform.NewObject("myQuery","sfquery","c:\ctsql\stone\sfquery\sfquery.vcx")

then you refer to it as thisform.myQuery.
thisform.RemoveObject('myQuery') && to remove.

However I think having it once in your form and calling its init might do :
thisform.SfQuery.Init
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform