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!

Deploying ODBC connection 2

Status
Not open for further replies.

MathiasB

Programmer
Aug 21, 2019
14
GB
Hi all,

I have a VFP client database that's full of remote views to an SQL Server database.

For simplicity there's a connection (user & password) to a named instance of SQL.

I know to make sure whatever ODBC driver is installed on clients.

But how does one actually deploy 'the existing' connection on clients, please?

Any advice, best practice much appreciated.

Thank you

Mathias
 
You've got two options.

First option, create a File DSN:

1. Open the ODBC applet as usual.

2. Go to the File DSN tab.

3. Click Add and go through the steps.

4. You will be prompted for a file name. Choose a file and location for saving the DSN file.

5. On completion, you will have all the DSN settings saved in that file (it will have the extension DSN). You can distribute the file to your users.

Second option: Within VFP, use SQLSTRINGCONNECT() to connect to the driver. You pass it a string containing the relevant ODBC parameters. In this case, you don't need to distribute anything to the users (assuming they have the correct driver installed, of course).

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
By the way, the DSN file is an ordinary text file which contains the same parameters that you would pass to SQLSTRINGCONNECT(). So another option would be to create the DSN file, then use that text to create the string that you pass to SQLSTRINGCONNECT(), after which you can discard the file.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
That's great Mike

I'll have a play with that cheers

KR

Mathias
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top