MySQL Forums
Forum List  »  Spanish

Re: stored procedure vs parámetro de salida
Posted by: José Mª Fueyo
Date: March 07, 2008 10:27AM

Hola Gonzalo

Public Sub prueba()
Dim cnn As ADODB.Connection, MiSP As ADODB.Command
Dim sNombre As ADODB.Parameter, sClave As ADODB.Parameter, _
sVersión As ADODB.Parameter, sResultado As ADODB.Parameter

Set cnn = New ADODB.Connection
With cnn
.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;User ID=root;Data Source=MiDSN"
.CursorLocation = adUseServer
.Open
.DefaultDatabase = "MiBase"
End With

'Configuro el comando
Set MiSP = New ADODB.Command
With MiSP
.ActiveConnection = cnn
.CommandType = adCmdStoredProc
.CommandText = "VerificarCredenciales"
.Prepared = True
End With

MiSP.Parameters.Append MiSP.CreateParameter("sNombre", adVarChar, adParamInput, 10)
MiSP.Parameters.Append MiSP.CreateParameter("sPW", adVarChar, adParamInput, 10)
MiSP.Parameters.Append MiSP.CreateParameter("iVersionFE", adInteger, adParamInput)
MiSP.Parameters.Append MiSP.CreateParameter("bResultado", adTinyInt, adParamOutput, , 0)

'Paso los valores
MiSP.Parameters("sNombre") = "Usuario"
MiSP.Parameters("sPW") = "Contraseña"
MiSP.Parameters("iVersionFE") = 77
MiSP.Execute

Debug.Print MiSP.Parameters("bResultado")


cnn.Close
Set cnn = Nothing

End Sub

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: stored procedure vs parámetro de salida
3288
March 07, 2008 10:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.