Store procedure com ADO

  • Thread starter Thread starter Alejandro
  • Start date Start date
A

Alejandro

I m trying to run this code , but i dont know how insert the parameters of
the store procedure, someone can help with this????

This is the code of the form:

Option Compare Database
Option Explicit
Public cn As ADODB.Connection

Private Sub Comando10_Click()

Dim inserta As ADODB.Command
Set cn = CurrentProject.Connection
Set inserta = New ADODB.Command
Set inserta.ActiveConnection = cn

inserta.CommandText = "inse1"
inserta.CommandType = adCmdStoredProc

inserta.Execute

and this is the code of the store procedure :

ALTER proc inse1 @conta int, @valor money as
insert xfinanceiro(conta, valor)
select @conta, @valor

How i can insert the parameters @conta and @valor ???

Thanks Alejandro
 
inserta.parameters.refresh
inserta.parameteres(1).value = "abc"
or
inserta.parameters("@conta").value = "abc"
 
Back
Top