Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a DSN in code.
Message
From
04/02/2008 17:13:39
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
04/02/2008 12:13:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01289107
Message ID:
01289333
Views:
14
>I am looking for a way to create a system DSN via code. We are migrating to SQL server. Currently, we will be pulling static history from SQL server for reports. To aid in the upgrading, I am looking for a way to generate the ODBC System DSN.

DSN is a textfile. Here's a sample:

[ODBC]
DRIVER=SQL Server
UID=sa
DATABASE=pubs
WSID=%COMPUTERNAME%
APP=Microsoft(R) Windows NT(R) Operating System
SERVER=(local)
Description=Object Pooling Bank Application DSN

The whole difference between a connect string and DSN is that string is a string and a file is a file, one uses semicolon for a delimiter, the other uses CR. In Fox, conversion between the two fits one line (well, one line one way, one more line to reverse).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform