>I have a connection to a remote SQL Database (working fine).
>I want to query a remote database but, not create a remote view in the existing database.
>Foxpro help doesn't mention any syntax for this (no connection keyword in the SQL-Select statement).
>Is it possible toquery a remote SQL table "on the fly" without creating a remote view?
>If so, what is the syntax?
You can use SQL Pass-Through (SPT): SQLCOONECT, SQLSTRINGCONNECT, SQLEXEC. Something like
lnConn = SQLCONNECT(< DSN >)
lnConn = SQLSTRINGCONNECT( < connection string > )
IF lnConn < 0
= AERROR(laOdbcError)
ENDIF
TEXT TO lcSql NOSHOW TEXTMERGE
SELECT * FROM dbo.mytable
TEXT
lnRet = SQLEXEC(lnConn, lcSql, "crsTemp")
IF lnRet < 0
AERROR(...)
ENDIF
...
--sb--