Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/05/2004, 17:28
hugoventus
 
Fecha de Ingreso: mayo-2004
Ubicación: Mexico
Mensajes: 4
Antigüedad: 21 años
Puntos: 0
Ayuda Por Favor ya no puedo mas

Tengo el sisguiente codigo en ASP:
<% Option Explicit %>
<!--#include file="comun.inc" -->
<!--#include file="adovbs.inc" -->
<%
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If

Dim rsPedi
Dim Comando
Dim Params
Dim dtvariable

Set Comando=server.createobject("ADODB.Command")
Set rsPedi=Server.CreateObject("ADODB.Recordset")
'Set Params=Server.CreateObject("ADODB.Parameters")

'sin parametros
'{
'With Comando
'Set .activeconnection=strCon
'.commandtext="dbo.Registro"
'.commandtype=adcmdStoredProc
'.Prepared = true
'Set rsPedi = .Execute()
'End with
'Set Comando=Nothing
'}

'con parametros
'{2003-01-09
dtvariable=DateValue("08/28/03")
With Comando
Set .activeconnection=strCon
.commandtext="dbo.RegistroFecha"
.commandtype=adcmdStoredProc
'Set params = .Parameters
.Parameters.Refresh
''.Parameters.Append .CreateParameter ("@fecha", adDate, adParamInput,8,dtvariable)
''.Parameters.Append .CreateParameter ("@fecha", adVarChar, adParamInput,50,strvariable)
.Parameters(1).value=Cdate("08/28/2003")
'params("@fecha") = DateValue("08/28/2003 00:00:00")
.Prepared = true
(46) Set rsPedi = .Execute()
End with
'rsPedi.Open Comando
'Set rsPedi = Comando.Execute ,,,adCmdStoreProc
Set Comando=Nothing
'}

'''Set rsPedi = strCon.Execute ("RegistroFecha " & "'8/28/2003'" & "")

%>


El Store Procedure es:
CREATE PROCEDURE RegistroFecha @fecha datetime AS
DECLARE @fechabus as datetime
SET DATEFORMAT mdy
Set @fechabus=@fecha
EXEC('Select * from inventarios where fechaped=' + @fechabus + ' order by fechaped ASC')
RETURN
GO


y me marca el siguiente error:
Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '1'.

/control/add_descargo.asp, line 46

La linea 46 viene especificada en el codigo de ASP.... no se si me puedan ayudar..... ya hice de todo lo que he visto publicado en estos foros y no funcionan tengo SQL 2000 server.... no se si tengan alguna sugerencia