Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fist attempt to sql server 2000
Message
 
To
21/10/2002 22:09:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00713741
Message ID:
00713989
Views:
10
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform