Link to home
Start Free TrialLog in
Avatar of shoooot
shoooot

asked on

Create a mdb database DSN with C...

Hello all,
I'd like to create DSN not by control panell (ODBC32) but programatically, is it possible?

I read something about a windows funciton:
ConfigDSN(...)
but I don't know how to use it, and which .h I have to include to use it. Any idea?

Thx
MARC
Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

yes,

SQLConfigDataSource(NULL,ODBC_ADD_DSN, "Excel Files (*.xls)",
                   "DSN=New Excel Data Source\0"
                   "Description=New Excel Data Source\0"
                   "FileType=Excel\0"
                   "DataDirectory=C:\\EXCELDIR\0"
                   "MaxScanRows=20\0");
Avatar of jhance
jhance

>>but I don't know how to use it, and which .h I have to include to use it. Any idea?


Have you ever heard of the MSDN Library?  It's in there.
Avatar of shoooot

ASKER

Yes I know MSDN, but is no way to find which include needs the function that is displayed in the help at that time...
Or I didn't see it.

MARC
ASKER CERTIFIED SOLUTION
Avatar of pagladasu
pagladasu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial