Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically creating a File DSN
Message
From
28/06/2001 01:45:43
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00524501
Message ID:
00524516
Views:
17
G'Day Andrew,

Of course, how simple. It didn't occur to me that a .DSN file was just an .INI type file.

Thanks Mate,
Gavin...

>Hi Gavin,
>
>This just seems to be a text file in .ini format. Here's one I created earlier (to get to a SQL server):
>
[ODBC]
>DRIVER=SQL Server
>;UID=sa
>DATABASE=JIWA
>WSID=T7020CT
>APP=Test
>SERVER=.
>Description=Local
>Trusted_Connection=True
>The files live (in my case) in the C:\Program Files\Common Files\ODBC\Data Sources>/tt> folder. I guess there's an API call to find out what that folder is. OTOH, maybe it doesn't matter where the DSN file lives, just as loong as you can provide and explicit, known path to it.
>Here's an Access file DSN I just created:
>
[ODBC]
>DRIVER=Microsoft Access Driver (*.mdb)
>UID=admin
>UserCommitSync=Yes
>Threads=3
>SafeTransactions=0
>PageTimeout=5
>MaxScanRows=8
>MaxBufferSize=2048
>FIL=MS Access
>DriverId=25
>DefaultDir=C:\Program Files\Microsoft Office\Office10\Samples
>DBQ=C:\Program Files\Microsoft Office\Office10\Samples\Northwind.mdb
>
>HTH
>
>Cheers,
>
>Andrew
>
>>Hi All,
>>
>> I know how to set up a File DSN through the ODBC Data Sources in the Control Panel, but does anyone know how to create a File DSN Programmatically with VFP code? I'm assuming that it'll need to be done via an API function. I would like to programmatically create File DSNs for ACCESS 2000 Databases and VFP6.0 Databases.
>>
>>Thanks,
>>Gavin...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform