Solved

Create a mdb database DSN with C...

Posted on 2002-03-04
5
268 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:shoooot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 6838881
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");
0
 
LVL 32

Expert Comment

by:jhance
ID: 6838975
>>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.
0
 

Author Comment

by:shoooot
ID: 6839093
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
0
 
LVL 4

Accepted Solution

by:
pagladasu earned 100 total points
ID: 6839432
To use ::SQLConfigDataSource, you must include the ODBCINST.H header file and use the ODBCINST.LIB import library. Also, ODBCCP32.DLL must be in the path at run time (or ODBCINST.DLL for 16 bit).
0

Featured Post

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question