Solved

ODBC Datasource 'Picker'

Posted on 2001-08-30
17
380 Views
Last Modified: 2013-12-03
Hi Folks,

is there something similar to CFileDialog that i can use to fire up the system ODBC manager and return a selected (new or existing) ODBC datasource?

thanks in advance for any suggestions!

regards,  Mike.
0
Comment
Question by:meverest
  • 9
  • 7
17 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6444575
0
 
LVL 7

Expert Comment

by:jimwasson
ID: 6445775
Have you looked at CDataSource::Open( hwnd, flags)?  It can give you a dialog allowing you to select the data source and driver.
0
 
LVL 37

Author Comment

by:meverest
ID: 6446846
thanks folks,

i'll check them both out and get back soon.

please feel free to remind me if it looks like i have forgotten!

cheers.
0
 
LVL 37

Author Comment

by:meverest
ID: 6448597
Hello,

yes! SQLManageDataSources() looks like ot is exactly what i am looking for....  the problem now, is "where can i find the prototypes and what do i lionk to in order to access that code from my application?

many thanks.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6449043
'sql.h' and odbc32.lib...
0
 
LVL 37

Author Comment

by:meverest
ID: 6449311
doesn't seem to be in sql.h...  i have downloaded the odbc dsk, looking if there are any clues in there...

cheers.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6449314
Sorry, I should take a look myself before posting, even when it's Sunday :o)

It's in odbcinst.h....
0
 
LVL 37

Author Comment

by:meverest
ID: 6449327
OK,

found it in odbcinst.h, nearly there.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 37

Author Comment

by:meverest
ID: 6449332
heheh - too quick for me ;-)
0
 
LVL 37

Author Comment

by:meverest
ID: 6449337
funny thing is...

it compiles and links all ok, but when i click the button:

void CQMCconfigDlg::OnChooseDSN()
{
    SQLManageDataSources( NULL );
}

nothing happens....  maybe i need something explicit for the CWnd argument?

regards.

0
 
LVL 37

Author Comment

by:meverest
ID: 6449398
ok, yes...

SQLManageDataSources is returning FALSE with invalid HWND - so where do i find a valid hwnd from my dialog-based app?

regards.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6451078
>>so where do i find a valid hwnd from my
>>dialog-based app

Well, use the hadle of your dialog window - or, if you don't really care, get yourself a handle using 'GetDesktopWindow()' :o)
0
 
LVL 86

Expert Comment

by:jkr
ID: 6459314
Hmm, anything new? :o)
0
 
LVL 86

Expert Comment

by:jkr
ID: 6496436
Well, did it work?
0
 
LVL 37

Author Comment

by:meverest
ID: 6498547
thanks for the reminder, i have not yet completed this project - have been side-tracked for the moment, but will get back to it eventually.

in the meantime, i will award this 'A' because your response *does* answer my question specifically - even if i have not figured out how to use it yet! ;-)

i will post another question when i get back to this project.

regards.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6498564
>>in the meantime, i will award this 'A'

Thank you!

(BTW: Did accepting an answer not work?)
0
 
LVL 37

Author Comment

by:meverest
ID: 6498587
you are right - i forgot to score it .... :-}

regards.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now