Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Invocar un SP desde pagina ASP
Message
 
À
07/03/2002 09:37:06
Fausto Garcia
Independent Developer
Lima, Pérou
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
00629542
Message ID:
00630085
Vues:
19
>Buenos dias!
>
>Tengo un stored procedure que recibe un parametro tipo string y devuelve (con RETURN) a su vez otro string. Alguien podria mostrarme con un ejemplo como invocar a ese stored procedure desde una pagina ASP?
>
>Muchas gracias,

Te paso parte de una página ASP que invoco a un SP de SQL, paso y recibo parámetros:
US = Request("Us")
FD = Request("Fd")
FH = Request("Fh")

Set oConn = Server.CreateObject("ADODB.Connection")
Set oCmd = Server.CreateObject("ADODB.Command")
Set oRs = Server.CreateObject("ADODB.Recordset")

oConn.CursorLocation = adUseClient 
oConn.ConnectionTimeout = 100

oConn.Open "Driver=SQL Server;Server=WSSQL7;Database=MyDB","MyUser","MyPass"
oCmd.CommandText = "spMySP"
oCmd.CommandType = adCmdStoredProc
oCmd.ActiveConnection = oConn

oCmd.Parameters.Append oCmd.CreateParameter("NroErr", adInteger, adParamOutput)
oCmd.Parameters.Append oCmd.CreateParameter("MsgErr", adChar, adParamOutput,255)
oCmd.Parameters.Append oCmd.CreateParameter("us", adChar, adParamInput, 10, Us)
oCmd.Parameters.Append oCmd.CreateParameter("fd", adChar, adParamInput, 10, Fd)
oCmd.Parameters.Append oCmd.CreateParameter("fh", adChar, adParamInput, 10, Fh)

Set oRs = oCmd.Execute()
Quizás te sirva. Saludos.
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform