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. Passing DB handle between applications

Passing DB handle between applications

Scheduled Pinned Locked Moved C / C++ / MFC
databasequestion
4 Posts 4 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
    User 563476
    wrote on last edited by
    #1

    Is anyone aware if it is possible to pass a db handle between two seperate applications? And if so how is this accomplished... do you utilize the command line of the CreateProcess command. And if so, how would you pass it (not sure how you would convert it to a string etc). What i am trying to accomplish is not to have to open the same DB on new instances of programs designed to perform certain task. This is an ODBC connection as well. Any insight is appreciated

    D B J 3 Replies Last reply
    0
    • U User 563476

      Is anyone aware if it is possible to pass a db handle between two seperate applications? And if so how is this accomplished... do you utilize the command line of the CreateProcess command. And if so, how would you pass it (not sure how you would convert it to a string etc). What i am trying to accomplish is not to have to open the same DB on new instances of programs designed to perform certain task. This is an ODBC connection as well. Any insight is appreciated

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Johnny Quintanilla wrote: ...is possible to pass a db handle between two seperate applications? By applications (and the mention of CreateProcess()), do you mean EXEs? If so, information sent to the spawned application is on the command-line. I'm not sure a handle would be valid across a process boundary.


      A rich person is not the one who has the most, but the one that needs the least.

      1 Reply Last reply
      0
      • U User 563476

        Is anyone aware if it is possible to pass a db handle between two seperate applications? And if so how is this accomplished... do you utilize the command line of the CreateProcess command. And if so, how would you pass it (not sure how you would convert it to a string etc). What i am trying to accomplish is not to have to open the same DB on new instances of programs designed to perform certain task. This is an ODBC connection as well. Any insight is appreciated

        B Offline
        B Offline
        Brian Shifrin
        wrote on last edited by
        #3

        >Is anyone aware if it is possible to pass a db handle between two seperate applications? Behavior varies from one database to another, from driver, etc etc etc. With Oracle sqlnet api handle may be can passed btw processes, also not supported. SqlLib handle, sqllib api can be passed safely cross boundary and I think is supported. ODBC drivers do NOT support such behavior, it may or may not work with next update of oracle or vendor driver. Proper solution would be to build out of process STA com object, that performs access to database.

        1 Reply Last reply
        0
        • U User 563476

          Is anyone aware if it is possible to pass a db handle between two seperate applications? And if so how is this accomplished... do you utilize the command line of the CreateProcess command. And if so, how would you pass it (not sure how you would convert it to a string etc). What i am trying to accomplish is not to have to open the same DB on new instances of programs designed to perform certain task. This is an ODBC connection as well. Any insight is appreciated

          J Offline
          J Offline
          Jorgen Sigvardsson
          wrote on last edited by
          #4

          Handles are most often bound to the process in which it was acquired. ODBC handles fall into that category! The post above this one mentions building an out-proc COM server for doing the actual database acces. This may or may not suit your needs. Is it necessary to share the actual connection between the processes? If not, then you can just pass the source DSN to the other processes. Otherwise, the COM server is your best shot. -- Watcha' gonna do, when Hulkamania runs wild on you!?

          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