Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question on SQL Server connections
Message
 
To
03/06/2002 12:00:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00664094
Message ID:
00664106
Views:
21
Randy

Here is the code I use to create a DSNless connection to the sql server:
= SQLSetProp(0, "displogin", 3)
lcDSNLess=[DRIVER={SQL SERVER};SERVER=]+ALLTRIM(gcDataSer)+[;UID=ctore;pwd=cqi$$;Network=DBMSSOCN;database=]+ALLTRIM(gcDataDB)+[;]
gnConnHandle=SQLSTRINGCONNECT(lcDSNless)
if gnConnHandle < 0
	=SQLERROR()
	return
endif
= SQLSETPROP(gnConnHandle, 'BatchMode', .T.)  
I store the gcDataSer and gcDataBD in a .mem variable. The first time the workstation accesses the application I prompt them for the Server Name and Database name, then I store them on the workstation and simply recall them.

Hope this help.

Kirk
Previous
Reply
Map
View

Click here to load this message in the networking platform