Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically creating a File DSN
Message
 
To
27/06/2001 23:52:53
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:
00524510
Views:
18
This message has been marked as the solution to the initial question of the thread.
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...


If we were to introduce Visual FoxBase+, would we be able to work from the dotNet Prompt?


From Top 22 Developer Responses to defects in Software
2. "It’s not a bug, it’s a feature."
1. "I thought I fixed that."


All my FoxTalk and other articles are available on my web site.


Unless specifically identified otherwise, anthing posted here is purely my opinion and may or may not reflect the policies or practices of Microsoft.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform