Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/12/2005, 10:14
Avatar de u_goldman
u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 4 meses
Puntos: 98
La tercera opcion es que uses el objeto command de ADO para enviar los datos como si se tratara de un stored procedure, de esta manera quedaria algo como:

Código:
Set ObjConn = Server.CreateObject("ADODB.Connection")
Set cmd = Server.CreateObject("ADODB.Command")

qry = "INSERT INTO tabla(campo1, campo2) VALUES(?,?)"

Set param = cmd.CreateParameter("campo1", adVarChar, adParamInput, 50, 'Hola Mundo')
cmd.Parameters.Append(param)
Set param = cmd.CreateParameter("campo2", adInteger, adParamInput, 4, 22)
cmd.Parameters.Append(param)

ObjConn.Open "string de conexion"
cmd.ActiveConnection = ObjConn
cmd.CommandType = adCmdText
cmd.CommandText = qry

cmd.Execute()

Set cmd = Nothing
Set param = Nothing
ObjConn.Close
Set ObjConn = Nothing
Mas informacion:

http://www.aspfaq.com/params.htm

Salu2,
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway