Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remote (SQL-Server) Query
Message
 
 
À
06/02/2004 22:15:54
John Tomblin
Service Station Systems, Inc.
San Jose, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00875082
Message ID:
00875085
Vues:
17
>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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform