Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote (SQL-Server) Query
Message
 
 
To
06/02/2004 22:15:54
John Tomblin
Service Station Systems, Inc.
San Jose, California, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00875082
Message ID:
00875085
Views:
18
>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 >)  
* or DSN-less connection
lnConn = SQLSTRINGCONNECT( < connection string > )
IF lnConn < 0
  = AERROR(laOdbcError)
  * ODBC Error, cannot proceed further
ENDIF
TEXT TO lcSql NOSHOW TEXTMERGE
SELECT * FROM dbo.mytable
TEXT
lnRet = SQLEXEC(lnConn, lcSql, "crsTemp")
IF lnRet < 0
  AERROR(...)
  * Process ODBC error
ENDIF
...
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform