Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create System DSN trough code?

Status
Not open for further replies.

Delphard

Programmer
Jul 22, 2004
144
RS
It is possible to create System DSN (in Data Sources (ODBC) console) automatically, from my program, or from some script?
 
Yeps.
Create a TRegistry and write to the registry at this keys:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<your odbc>
and
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
.

A tip. Create a System ODBC datasource from your control panel, and then review the registry at the above mentioned sections.

KungTure-RX.jpg

//Nordlund
 
Would you not be better using ADO as datasources wouldn't be required with that?

 
Indeed, I use ADO components to connect to MySQL. I dont know other way, except using System DSN to make connection trough MySQL ODBC 3.51 Driver. If you do, let me know...
 
hi
What do you have in your connectionstring for the Provider part? Just looking in Google and found some examples but unsure whether I'm on the right track here as I've never used MySQL. Will post some of them in a mo...

lou

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top