>>One way is to have a completely dynamic where clause, e.g.,
>>CREATE SQL VIEW lvMyView AS ;
>> SELECT * FROM parcel ;
>> WHERE &?lcPermitSearch
>>
>>Notes:
>>The "&" goes in front of the "?"
>>
>>This cannot be done in the view designer.
>>What you can do with the View Designer, however, is add the fields as you would want them, set the updatability of each, etc., then run GenDBC[X] -- actually GetView() from GenDBC[X] -- to get the definition of the view.
>>Then you can add the
WHERE &?lcPermitSearch
in the code and recreate the view.
>>
>>Then all you would have to is USE or REQUERY() the view instead of the SELECT.
>>
>
>Hi Trey,
>
>I'm somewhat 'view challenged' , so please forgive my ignorance in this area. With this approach is the CREATE SQL VIEW myview AS... still going to be in the DBC or am I just using the DBC to do some of the work for me (write some code for, send updates etc.)and then capture it with GENBDC and place it in a form method somewhere. Also, I couldn't find GetView(). As you can tell, I'm not quite there yet...but having fun!
>
>Thanks for your help.
>
>John
The view is created in the current DBC, and it will remain there until it is dropped. There is no need to create it again in the form. The database
To find GetView, modify GenDBC.prg then pull up the Procedure/Function List (right click menu), then go to GetView.
You may need to modify this slightly to be able to extract the information you need.
This is basically the code I use to call GetView
( I left out some validation for clarity )
LParameters tcView
Do Case
Case File("Gendbcx.prg")
lnHandle = FCreate(ForceExt(tcView,"prg"))
If lnHandle > 0
Set Procedure To GenDBCX
GetView(tcView, lnHandle, "")
FClose(lnHandle)
EndIf
Case File("Gendbc.prg")
Set Procedure To GenDBC
GetView(tcView, ForceExt(tcView,"prg"))
Otherwise
Return
EndCase
Modify Command (tcView) Nowait
Under this scenario, either will create a PRG with the same name as the view.
GenDBCX will start with
PROCEDURE lv_MyViewName....
GenDBC will start with
FUNCTION MakeView_lv_MyViewName...
Insanity: Doing the same thing over and over and expecting different results.