'DECLARACIÓN DE VARIABLES GLOBALES Dim Cmd, CmdAccess As ADODB.Command Dim Rs, RsAccess As ADODB.Recordset Dim strCnn, opa As String Dim strSQL, StrSqlAccess As String Dim param1 As Parameter, param2 As Parameter, param3 As Parameter Dim provStr As String 'INICIALIZAMOS LA CONEXIÓN AL SQL SERVER Set mconsql = New ADODB.Connection strCnn = "PROVIDER=MSDASQL;dsn=CON_SQL;uid=sys;pwd=" With mconsql .ConnectionString = strCnn .CursorLocation = adUseClient .Open End With 'CREO UN OBJETO COMMAND PARA ENVIAR PARAMETROS AL PROC ALMACENADO Set Cmd = New ADODB.Command Set Cmd.ActiveConnection = mconsql ' EL NOMBRE DEL PROCEDIMIENTO ALMACENADO Cmd.CommandText = "user.proc" Cmd.CommandType = adCmdStoredProc 'MI PROC ALMACENADO RECIBE 2 PARAMETROS DE ENTRADA, ' AQUI LOS CREO Set param1 = Cmd.CreateParameter("input1", adSingle, adParamInput) Cmd.Parameters.Append param1 Set param2 = Cmd.CreateParameter("input2", adSingle, adParamInput) Cmd.Parameters.Append param2 ' LES PONGO VALORES A LOS PARAMETROS param1.Value = Trim(T_ANOMES.Text) param2.Value = Trim(T_COORD.Text) 'EL PROC ME DEVUELVE UN RECORDSET QUE LO ALMACENO EN UNA TABL DE ACCESS Set Rs = New ADODB.Recordset Rs.CursorType = adOpenStatic Rs.LockType = adLockReadOnly Set RsAccess = New ADODB.Recordset 'AQUI HAGO LA LLAMADA AL PROCEDIMIENTO Set Rs = Cmd.Execute