Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fist attempt to sql server 2000
Message
 
À
21/10/2002 22:09:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00713741
Message ID:
00713989
Vues:
11
>hi all,
>how do i fist attempt to connect to data in sql server 2000,
>sample code would be help
>thank's

Hi Irwan,

Here is a simple example.
* name of my ODBC connection
lcOdbcConnection = 'Test_QRM_Assistant'

* make connection to sql server using ODBC connection defined using
* windows authentication (so no need to speciy password)
lnHandle = SQLCONNECT(lcOdbcConnection)
IF lnHandle <= 0
	=MESSAGEBOX('Unable to connect to &lcOdbcConnection ODBC connection.')
	RETURN
ENDIF

* retrive the DirectoriesToProcess table from the remote
* extractorcontrol database and place the result in a local
* cursor called temp
lcCommand = 'select * from extractorcontrol..DirectoriesToProcess'
lnOK = SQLEXEC(lnHandle,lcCommand, 'temp')
IF lnOK != 1
	=MESSAGEBOX('Error retrieving data!')
	RETURN
ENDIF

* disconnect
= SQLDISCONNECT(lnHandle)
Vern
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform