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
Solved

ODBC Datasource 'Picker'

Posted on 2001-08-30
17
386 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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