CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: ODBC

  1. #1
    Join Date
    Apr 1999
    Posts
    32

    ODBC

    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


  2. #2
    Guest

    Re: ODBC

    you may add the database phase,like this:
    m_DBDescw.OpenEx("DSN=SYSDD;UID=UserId;PWD=Password;Database=???");


  3. #3
    Join Date
    Apr 1999
    Posts
    5

    Re: ODBC

    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.


  4. #4
    Join Date
    May 1999
    Posts
    7

    Re: ODBC

    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.

  5. #5
    Guest

    Re: ODBC

    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.


  6. #6
    Guest

    Re: ODBC

    try this
    m_DBDescw.OpenEx( _T("DSN=SYSDD;UID=UserId;PWD=Password") ) ;

    and still get the problem send me u r code
    [email protected]

    mahesh



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured