Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. OLE DB Problem

OLE DB Problem

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpcsssql-servercom
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Deem
    wrote on last edited by
    #1

    Howdy, I have a stored procedure in MS SQL Server 2000 which performs some inserts and then a select statement. If the inserts fail (for example violating primary key contraints) i still would like to retrieve the results of the select statement. To illustrate this: insert into table values (1) insert into table values (1) /*violates primary key*/ insert into table values (2) Select stuff from table executing this in the query manager i get an error message about the failed insert and a grid for the select statement. Using OLE DB, The Execute() method fails with DB_E_INTEGRITYVIOLATION and no result set is returned! Is there anyway to either suppress the error information generated by SQL Server so that the client is never informed of the failed insert, OR is there anyway to get OLE DB to give me the result set? I have simplified the problem a lot so it might seem like I'm trying to do something senseless. Essentially I attempt a bunch of actions and the select at the end returns a bunch of error information. :) Any assistance would be greatly appreciated! ~Alex Deem

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups