meverest
asked on
ODBC Datasource 'Picker'
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you looked at CDataSource::Open( hwnd, flags)? It can give you a dialog allowing you to select the data source and driver.
ASKER
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.
i'll check them both out and get back soon.
please feel free to remind me if it looks like i have forgotten!
cheers.
ASKER
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.
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.
'sql.h' and odbc32.lib...
ASKER
doesn't seem to be in sql.h... i have downloaded the odbc dsk, looking if there are any clues in there...
cheers.
cheers.
Sorry, I should take a look myself before posting, even when it's Sunday :o)
It's in odbcinst.h....
It's in odbcinst.h....
ASKER
OK,
found it in odbcinst.h, nearly there.
found it in odbcinst.h, nearly there.
ASKER
heheh - too quick for me ;-)
ASKER
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.
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.
ASKER
ok, yes...
SQLManageDataSources is returning FALSE with invalid HWND - so where do i find a valid hwnd from my dialog-based app?
regards.
SQLManageDataSources is returning FALSE with invalid HWND - so where do i find a valid hwnd from my dialog-based app?
regards.
>>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)
>>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)
Hmm, anything new? :o)
Well, did it work?
ASKER
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.
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.
>>in the meantime, i will award this 'A'
Thank you!
(BTW: Did accepting an answer not work?)
Thank you!
(BTW: Did accepting an answer not work?)
ASKER
you are right - i forgot to score it .... :-}
regards.
regards.