>>Hi Mark,
>>
>>Your close enough to the problem. Now you can see why I need to get rid of any refrence to the table name because It will be not available. I will have recreate the alias with only the fields that are need for comparison, but I still need to be able to a query on the recreated alias, but I can not. Any help is very much appreciate.
>
>Once the saving of the QPR is completed, you might try the FileToStr() to convert the QPR to a string. Something like--
>lcQPR = FileToStr("MyQuery.QPR")
>lcQPR = strtran(lcQPR, "MyTable.", "")
>** of course you would have to figure out what tables were used
>** you can use the AT() function to look for the periods
>lnRetVal = StrToFile(lcQPR, "MyQuery.QPR")
>if lnRetVal > 0
> *** successful
>else
> *** not successful
>endif
>I am afraid there are not many options for you on this.
Another altertnative is to get the SQL command from the view definition in the dbc using DBGETPROP, put that command into a string variable, manipulate the string to change the dbf name (including path) to the table's alias, then use the the CREATE SQL VIEW using the newly changed string as the SQL command and overwriting the prior SQL view with the new one.
For example,
theSQL = DBGETPROP('someview','view','sql')
***
*** manipulate theSQL to the new SQL syntax replacing the dbf with the alias
***
CREATE SQL VIEW someview as &theSQL