How to invoke configure dialog for a File DSN from C program? I can do it for System/user DSN using SQLConfigDataSource.
Thanks in advance,
Manoj
Printable View
How to invoke configure dialog for a File DSN from C program? I can do it for System/user DSN using SQLConfigDataSource.
Thanks in advance,
Manoj
Yes, You can create either System DSN or User DSN using the API SQLConfigDataSource(). :)
User or system data sources can be created by an ODBC application that calls the SQLConfigDataSource function with the fRequest parameter set to either ODBC_ADD_DSN or ODBC_ADD_SYS_DSN.
I cannot understand why you're looking to invoke the DSN COnfiguration wizard window through a program. :confused:
You can easily do it via Windows API's. :)
The program for DSN Config wizard dialog is "odbcad32.exe" located in the "WINDOWS\System32" folder. You can try programatically executing the pogram.
Hopes this helps :)
Thanks for your time.
Using SQLConfigDataSource I can modify a system/user DSN also, similarly I want to modify a "FILE DSN", i don't wan to invoke the Manage DSN dialog, i just want to invoke the modify configuration dialog for a "FILE DSN".
Here is an Article in the Microsoft Knowledgebase, you may check out that :
http://support.microsoft.com/kb/q165866/
It describes pretty welll about DSN Less connections and FILE DSN connections.
Hi, thanks for your reply.
I think you misunderstood my requirement. I can create a FILE DSN there is no problem, the requirement is how can I popup the configure FILE DSN dialog just like when we modify a System/User DSN using SQLConfigDataSource with a valid handle as the first parameter. Using this dialog we can configure the data format using "Define format...", which will in turn create a schema.ini in the data folder(I am talking about microsoftt text/csv driver.
if you really want to popup the Configure File DSN Dialog, whats the problem in invoking "odbcad32.exe" in the system32 folder?? :confused:
The same dialogbox provides tabs for System DSN, User DSN, File DSN, Drivers etc.. etc... :)
You need to programatically ShellExecute() the "odbcad32.exe" to popup the dialog. File DSN config is in the 3rd Tab. :)
How can you create a software there users need to think? here if I am showing Manage DSN dialog then user need to navigate to FILE DSN tab and he need to identify the file? why introducing these complexity to the user?