DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Execute Store Procedure (ADO)

  1. #1
    Dbones Guest

    Execute Store Procedure (ADO)


    I have this in RDO 2.0.


    Set Sp = New rdoQUERY
    sqls$ = "{call MN_Procedure(?,?,?,?)}"
    Set Sp = CN.CreateQuery("", sqls)

    Sp(0) = var1
    Sp(1) = var2
    Sp(2) = var3
    Sp(3) = var4
    Sp.Execute
    Sp.Close



    How do I make this in ADO?
    Thank you

  2. #2
    Tonny H Guest

    Re: Execute Store Procedure (ADO)


    Dim conn as new adodb.connection

    conn.open strConnection <== your connection string

    conn.execute ("sp_NAME")

    -t-


    "Dbones" <dbonesso@mercovia-sa.com.br> wrote:
    >
    >I have this in RDO 2.0.
    >
    >
    > Set Sp = New rdoQUERY
    > sqls$ = "{call MN_Procedure(?,?,?,?)}"
    > Set Sp = CN.CreateQuery("", sqls)
    >
    > Sp(0) = var1
    > Sp(1) = var2
    > Sp(2) = var3
    > Sp(3) = var4
    > Sp.Execute
    > Sp.Close
    >
    >
    >
    >How do I make this in ADO?
    > Thank you



  3. #3
    Brian Kennedy Guest

    Re: Execute Store Procedure (ADO)


    'first, get a connecition
    dim con as adodb.connection
    set con = createobject("adodb.connection")
    con.open your_connectstring 'can use odbc dsn, ole-db...
    dim cmd as adodb.command
    set cmd = createobject("adodb.command")
    set cmd.activeconnection = con
    cmd.commandtype = adcmdstoredproc
    cmd.commandtest = your_storedproc_name
    cmd.parameters(0) = your_first_param
    cmd.parameters(1) = your_2nd_param

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center