SQL query in C++

Discussion in 'C++' started by karol1208, May 1, 2007.

  1. karol1208

    karol1208 Guest

    I have problem with sending query (form C++ MFC program) to data base.
    When i send query with "SELECT" everything is ok. But when I send the
    one with "UPDATE" or "INSERT" I get exeption.
    I use:

    CDatabase::OpenEx

    "DRIVER={SQL
    Server};DATABASE=database;SERVER=server;UID=login;PWD=password"

    OpenEx(pszDest, CDatabase::noOdbcDialog );

    CMyRecordset.Open(CRecordset::dynaset,strQuery1,NULL ))

    When I use SQL Manager with this same connection parameters (login,
    password, server...) everything is ok.
     
    karol1208, May 1, 2007
    #1
    1. Advertising

  2. karol1208

    Lionel B Guest

    Lionel B, May 1, 2007
    #2
    1. Advertising

  3. karol1208 skrev:
    > I have problem with sending query (form C++ MFC program) to data base.
    > When i send query with "SELECT" everything is ok. But when I send the
    > one with "UPDATE" or "INSERT" I get exeption.
    > I use:
    >
    > CDatabase::OpenEx
    >
    > "DRIVER={SQL
    > Server};DATABASE=database;SERVER=server;UID=login;PWD=password"
    >
    > OpenEx(pszDest, CDatabase::noOdbcDialog );
    >
    > CMyRecordset.Open(CRecordset::dynaset,strQuery1,NULL ))
    >
    > When I use SQL Manager with this same connection parameters (login,
    > password, server...) everything is ok.
    >


    Ever bothered checking what the exception is telling you?

    --
    OU
     
    Obnoxious User, May 1, 2007
    #3
  4. karol1208

    karol1208 Guest

    On Tue, 01 May 2007 15:46:29 +0200, Obnoxious User <OU@127.0.0.1>
    wrote:


    >Ever bothered checking what the exception is telling you?


    I've try but I still get a "Microsoft Visual C++ Debug Lirary" Message
    Error Box.
     
    karol1208, May 1, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Learner
    Replies:
    1
    Views:
    1,004
    Marina Levit [MVP]
    Jan 30, 2006
  2. Edward
    Replies:
    4
    Views:
    4,624
    William \(Bill\) Vaughn
    Apr 10, 2006
  3. Anonymous
    Replies:
    0
    Views:
    1,512
    Anonymous
    Oct 13, 2005
  4. David Gordon

    xpath query query

    David Gordon, May 18, 2005, in forum: XML
    Replies:
    2
    Views:
    805
    David Gordon
    May 18, 2005
  5. ecoolone
    Replies:
    0
    Views:
    782
    ecoolone
    Jan 3, 2008
Loading...

Share This Page