Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a system DSN using SQLconfigDataSource

Status
Not open for further replies.

APS

Vendor
Sep 25, 2000
53
US
I can create a new user DSN using the SQLConfigDataSource command, but what do I change to create a system DSN?

DECLARE Integer SQLConfigDataSource in odbccp32.dll Integer, ;
Integer, String, String

settings="DSN=testing"+chr(0)+;
"Description=VFP ODBC Driver"+chr(0)+;
"SourceDB=v:\tmwinabs\abs\data\contacts.DBC"+chr(0)+;
"SourceType=DBC"

=SQLConfigDataSource(0,1,"Microsoft Visual FoxPro Driver",settings)

Thanks,
Anthony
 
I abandoned trying to create any kind of DSN when I found SQLStringConnect ... if you're trying to programmatically create DSNs, then your program knows all the settings already, so why not keep changes in the ODBC settings from affecting your program by making your program ALWAYS responsible for the connection, with SQLStringConnect?
 
I attempting to avoid having to set up the ODBC source on all the machines. Which I will have to do first to use the SqlStringConnect command, correct?
 
You only need to have the ODBC driver installed, which should install at the same time as your VFP runtimes & .EXE file simply by selecting the "Microsoft Visual Foxpro ODBC Driver" merge module in InstallShield (or whatever installation builder you use).

The SQLStringConnect includes all the necessary parameters so that no DSN is necessary, see:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top