Option Explicit
Public Function ExecCmd(sSQL As String) As ADODB.Recordset
On Error GoTo ErrCmd
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim StCo As String
Set cn = New ADODB.Connection
StCo = "Provider=MSDASQL.1;" _
& "Extended Properties='Driver={Microsoft Visual FoxPro
Driver};" _
& "UID=;PWD=;SourceDB=g:\sad\bases;" _
& "SourceType=DBF;Exclusive=No;" _
& "BackgroundFetch=SÝ;" _
& "Collate=Machine;" _
& "Null=SÝ;" _
& "Deleted=SÝ'"
cn.Open StCo
Set rs = New ADODB.Recordset
rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
Set ExecCmd = rs
Set rs = Nothing
Set cn = Nothing
Exit Function
ErrCmd:
Set rs = Nothing
cn.Close
Set cn = Nothing
Err.Raise Err.Number, Err.Source, "Error al recuperar datos. " &
vbCrLf & Err.Description
End Function
La clase se llama CExec_Cmd
ejecuto la pagina asp, y me muestra el siguiente error:
--------------------------------------------------------------------------------
Información técnica (para personal de soporte técnico)
Tipo de error:
Error de Microsoft VBScript en tiempo de ejecución (0x800A000D)
No coinciden los tipos: 'ExecCmd'
/user/proforma.inc, line 25
Tipo de explorador:
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; T312461)
Página:
POST 39 bytes to /user/proforma.asp
Datos de POST:
cserv=231&cuser=maximo&nproforma=020845
Hora:
jueves, 09 de mayo de 2002, 20:25:57
No se que puede ser , ayudeme o deme una manito
Les envio mi codigo de mi pagina asp:
<%
Dim Conex
Dim rss
nMonth = month(date )
if len(nmonth)=1 then nmonth = "0" & nmonth
nYear = right(year(now),2)
i = 0
Set oConex = Server.CreateObject("Exec_Cmd.CExec_Cmd")
Set rss = Server.CreateObject("ADODB.RecordSet")
do
ssql = "select tiporeg, substr(cont1,1,27), c_aduana, cod_p_pro,
nave, fchlle,"
ssql = ssql & "fobgtos_d, fob_dol, flete_dol, seguro_dol,
t_cambio,"
ssql = ssql & "kbr, bulto, c_bulto,
dder1,dder2,dder3,dder4,dder5,dder6,dder7,dder8,"
ssql = ssql & "obsve1,obsve2,obsve3,obsve4,obsve5,obsve6,obsve7,obsve8,"
ssql = ssql & "obsve9,obsve10,obsve11,obsve12,obsve13,obsve14,obsve15,obsve16,"
ssql = ssql & "tdder, dcomision, digv, tdgas, dtot_prof,cod_clien
"
ssql = ssql & "from pro" & nMonth & nYear & "1 "
ssql = ssql & "where n_prof = '" & Request.Form("nproforma") & "'
"
Set rss = oConex.ExecCmd( ssql )
i = i + 1
nMonth = nMonth - 1
if nMonth = 0 then
nMonth = "12"
nyear = nyear - 1
nyear = cstr(nyear)
if len(nyear)=1 then nyear = "0" & nyear
else
nmonth = cstr(nmonth)
if len(nmonth)=1 then nmonth = "0" & nmonth
end if
if i=12 then
exit do
end if
loop while rs.eof %>
"Marco Muñoz" <marcoan...@hotmail.com> wrote in message news:1557071b.02050...@posting.google.com...