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. Accessing a Sybase Stored Procedure

Accessing a Sybase Stored Procedure

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++databasevisual-studio
3 Posts 3 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.
  • U Offline
    U Offline
    Unplugged
    wrote on last edited by
    #1

    I'm having some problems here. What I want to do is access a sybase stored procedure through a c++ program. The problem I'm having is, 1) adding a data source to an already existing program. (I'm using Microsoft Visual Studio). 2) how to call the stored procedure and how to acess the results. If anyone can give me any help it would be most appreciated. ICXC NIKA

    J B 2 Replies Last reply
    0
    • U Unplugged

      I'm having some problems here. What I want to do is access a sybase stored procedure through a c++ program. The problem I'm having is, 1) adding a data source to an already existing program. (I'm using Microsoft Visual Studio). 2) how to call the stored procedure and how to acess the results. If anyone can give me any help it would be most appreciated. ICXC NIKA

      J Offline
      J Offline
      jmkhael
      wrote on last edited by
      #2

      http://www.codeproject.com/database/readdb.asp[^] Update ur driver in the code to the sybase driver installed ( u can check it in the ODBC in control panel) and use SQL like EXEC storedProcedure ( or call , i dont recall exactly:)) eg. exec sp_FileExist 'F', 'CLNHLDY_DBF' Hope this helps Papa while (TRUE) Papa.WillLove ( Bebe ) ;

      1 Reply Last reply
      0
      • U Unplugged

        I'm having some problems here. What I want to do is access a sybase stored procedure through a c++ program. The problem I'm having is, 1) adding a data source to an already existing program. (I'm using Microsoft Visual Studio). 2) how to call the stored procedure and how to acess the results. If anyone can give me any help it would be most appreciated. ICXC NIKA

        B Offline
        B Offline
        basementman
        wrote on last edited by
        #3

        You need to either use the Sybase CTlib directly or use a higher level abstraction layer, such as ODBC or ADO. If using ODBC, you need the Sybase ODBC driver installed on the system and configured correctly. Once that is done, you can use SQLExecDirect or SQLPrepare/SQLExecute to invoke the SP. Remember that you either need to change to the appropriate database (using a CTLib function or SQL USE {database} query -OR- embed the database name in the procedure) sprintf(caSQLBuf,"exec %s.dbo.MyProcedure '%s'", caDBName, caParam1); SQLExecDirect(caSQLBuf). Let me know if you need a generic ODBC class library or if you don't want to roll your own.

        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