ODBC question - creating DSN directly from app 
Author Message
 ODBC question - creating DSN directly from app

Hello,
I have a dialog-based app which uses 2 ActiveX controls (DBGrid and
RemoteDataCtrl). I acces the database through ODBC. Which is my
question? I want to create the ODBC Data Source directly from my app
without using ODBC Admin from Control Panel, like in InitInstance
function.I don't have a CDatabse class or CRecordset class. I simple
use those 2 ActiveX. Can I do it? Do you have a sample code?
Thanx
Bogdan Paduraru

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Thu, 25 Apr 2002 03:00:00 GMT  
 ODBC question - creating DSN directly from app

Quote:

> I want to create the ODBC Data Source directly from my app
> without using ODBC Admin from Control Panel, like in InitInstance
> function.

This line:

SQLConfigDataSource(hWnd, ODBC_ADD_SYS_DSN,  lpszDriver, lpszDSN);

creates a system data source. The last parameter is a string containing the
name of your data source. The next to last parameter is the driver to use
with the DSN. You can get the valid driver names by calling

SQLGetInstalledDrivers();

Regards,
Will



Thu, 25 Apr 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to create an ODBC DSN programatically ?

2. Create DSN to Oracle ODBC Driver Programatically- HOW?

3. User DSN vs Sys DSN vs File DSN.

4. how to register new DSN in ODBC Adminstrator ( using C# )

5. file DSN with ODBC-Admin?

6. I wish to add a DSN to my 32-bit ODBC List Programmatically

7. Connecting to an MDB file thru ODBC *without* using DSN

8. ODBC SYSTEM DSN

9. SQL server 2000 , a bug related to ODBC DSN ADO related

10. CDatabase Can't Open System DSN with ODBC 3.0 SDK

11. Help! Visual C++ 1.52 ODBC DSN

12. hide odbc DSN

 

 
Powered by phpBB® Forum Software