Click to See Complete Forum and Search --> : ODBC


Nicola
April 29th, 1999, 09:40 AM
Hello, I'm using CDatabase and CRecordset classes to access to an Oracle DataBase. I have created on the Windows Control Panel a new DSN called "SYSDD".
In the application I have the member CDatabase m_DBDescw

to access to the database I would like to know if it's right the following set of statements:

if(m_DBDescw.IsOpen())
return true;

try
{
m_DBDescw.OpenEx("DSN=SYSDD;UID=UserId;PWD=Password");
}
catch(..)
.....

The userId and Password to specify are those of the DB I want to use?
If yes, Could you possibly give me some clues on why it doesn't work?
Thank you for your attention!!!! Nicola

May 5th, 1999, 09:52 PM
you may add the database phase,like this:
m_DBDescw.OpenEx("DSN=SYSDD;UID=UserId;PWD=Password;Database=???");

Bob C.
May 6th, 1999, 08:19 AM
What is the error? Problem may be that you don't have the DSN/SERVER defined, Oracle client is not configured, etc. You can also add the SERVER name to the Open string if necessary.

jaylauriano
May 6th, 1999, 02:12 PM
Email a description of the exception returned. I have experience with DAO/ODBC.

Freedom is knowing you can burn all your software without losing a minute's sleep.

May 12th, 1999, 05:30 AM
You should try by adding the word "ODBC" in the string for the OpenEx function.

Of course, the userId and the password are the database one.

Also, verify that you have the right to connect to the server, if you are using a network. You can map a server drive then try your program.

Stephane BOUDOU.

May 12th, 1999, 11:04 AM
try this
m_DBDescw.OpenEx( _T("DSN=SYSDD;UID=UserId;PWD=Password") ) ;

and still get the problem send me u r code
mchand@kruseinc.com

mahesh