Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/10/2006, 08:29
mopadu84
 
Fecha de Ingreso: octubre-2006
Mensajes: 25
Antigüedad: 18 años, 6 meses
Puntos: 0
y éste otro archivo se llama ADORecordset.asp qe es donde se abre la conexión
<%@ LANGUAGE="VBSCRIPT" %>
<%

permiso = request.QueryString("permiso")
reportname = "./Reportes/comovamos.rpt"
reportname1 = "./Reportes/Sub1comovamos.rpt"
'reportname = "./Reportes/Subcomovamos.rpt"
%>
<!-- #include file="AlwaysRequiredSteps.asp" -->
<%
set CRSubreports = session("oRpt").OpenSubReport(reportname1)
if permiso = 1 then
razonSocial = request.QueryString("Descripcion_Cliente")
fechaInicial = request.QueryString("FechaInicial") 'fecha inicial
'fechaFinal = Year(fechaInicial) & "-" & Month(fechaInicial) & "-" & Day(fechaInicial)
fechaInicial = Year(fechaInicial) & "-" & Day(fechaInicial) & "-" & Month(fechaInicial) & " 00:00"
'This line creates an ADO Connection object
Set oADOConnection = Server.CreateObject("ADODB.Connection")
'can then open a connection to the Database DSN.
oADOConnection.Open ("DsSite")
'This line creates an ADO Recordset object
Set oADORecordset = Server.CreateObject("ADODB.Recordset")
'Set crRep = Server.CreateObject("CRAXDRT.Report")
Set oADOSubRecordset = Server.CreateObject("ADODB.Recordset")
'We can then populate the recordset object by executing a SQL statement
'agains the database (using the connection object)
'Set oADORecordset = oADOConnection.Execute("exec SP_VentasxEstacion @Fecha = '2006-10-06'")

'texto1 = "SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON DECLARE @SQLString NVARCHAR(500) SET @SQLString = 'exec SP_VentasxEstacion @Fecha = "
'texto1 = Replace(texto1,"'","&quot;")

'texto2 = "' + CHAR(13) SET @SQLString = @SQLString + 'exec SP_InventariosxEstacion @Fecha = "
'texto2 = Replace(texto2,"'","&quot;")

'texto3 = "' + CHAR(13) EXEC sp_executesql @SQLString"
'texto3 = Replace(texto3,"'","&quot;")
'texto = texto1 & "'2006-06-10'" & texto2 & "'2006-06-10'" & texto3
'response.Write(texto)

'Set oADORecordset = oADOConnection.Execute(texto)

Set oADORecordset = oADOConnection.Execute("exec SP_VentasxEstacion @Fecha = '" & fechaInicial & "'")
Set oADOSubRecordset = oADOConnection.Execute("exec SP_InventariosxEstacion @Fecha = '" & fechaInicial & "'")
'Set oADORecordset = oADOConnection.Execute("exec SP_InventariosxEstacion Fecha = '" & fechaInicial & "' +'go' + char(13)")
'Set oADORecordset = oADOConnection.Execute("Select [Employee ID],[First Name], [Last Name] From Employee Where [Employee ID] >= 13")
'response.Write("Query " & fechaInicial & "<br> RPT" & reportname)
'This line creates a reference to a table object for the report. With ADO each report
'should only contain a single table as all the data will be supplied by the recordset.
Set oRptTable = session("oRpt").Database.Tables.Item(1)
'Once we have a reference we can then set the tables datasource to be the recorset object.
oRptTable.SetDataSource oADORecordset, 3
'response.Write("Result " & oADORecordset(0) & "<br>")
'Do While Not oADORecordset.EOF
'response.Write("Result " & oADORecordset(0) & "<br>" & oADORecordset(3)& "<br>")
'oADORecordset.MoveNext
'Loop
Set oRptSubTable = CRSubreports.Database.Tables.Item(1)
oRptSubTable.SetDataSource oADOSubRecordset, 3
'Set crRep = Nothing

'Session("oRpt").Refresh()
response.Write("Fecha" & fechaFinal)
Session("oRpt").FormulaFields.GetItemByName("Encab ezado").Text = CStr("'" & razonSocial & "'")
Session("oRpt").ParameterFields.GetItemByName("@Fe cha").AddCurrentValue(CDate(fechaInicial))
Session("oRpt").ParameterFields.GetItemByName("@Fe cha", "Sub2comovamos").AddCurrentValue(CDate(fechaInicia l))
'Session("oRpt").ParameterFields.GetItemByName("da te").AddCurrentValue(CDate(fechaFinal))
end if
%>
<!-- #include file="MoreRequiredSteps.asp" -->
<!-- #include file="SmartVieweractivex.asp" -->