
16/06/2008, 10:16
|
| | Fecha de Ingreso: junio-2008
Mensajes: 5
Antigüedad: 16 años, 10 meses Puntos: 0 | |
4 BD desde ASP Hola amigos tengo un problema con una pagina en asp, necesito hacer una suma con 4 bases diferentes que se encuentran en SQL Server
generada desde la pagina asp, estan estan en el mismo servidor, estas bases contienen la misma informacion pero de diferentes estados,
si genero un query en SQL Server me despliega la informacion correctamente, pero si lo genero de igual forma en la pagina asp me marca
error de apertura alguien puede ayudarme porfavor.
De antemano muchas gracias y espero que alguin me pueda ayudar con este problema
Dim rstPanel
Dim rstPanel1
Dim rstPanel2
Dim rstPanel3
Set rstPanel = Server.CreateObject("ADODB.Recordset")
Set rstPanel1 = Server.CreateObject("ADODB.Recordset")
Set rstPanel2 = Server.CreateObject("ADODB.Recordset")
Set rstPanel3 = Server.CreateObject("ADODB.Recordset")
rstPanel.Open "SELECT " & _
"[MEX].[SYS_SUB].[SEM1] + [GDL].[SYS_SUB].[SEM1] + [MTY].[SYS_SUB].[SEM1] + [TIJ].[SYS_SUB].[SEM1] AS [ACTUAL1], " & _
"[MEX].[SYS_SUB].[1PLAN] + [GDL].[SYS_SUB].[1PLAN] + [MTY].[SYS_SUB].[1PLAN] + [TIJ].[SYS_SUB].[1PLAN] AS [PLAN1], " &
_
"[MEX].[SYS_SUB].[SEM2] + [GDL].[SYS_SUB].[SEM2] + [MTY].[SYS_SUB].[SEM2] + [TIJ].[SYS_SUB].[SEM2] AS [ACTUAL2], " & _
"[MEX].[SYS_SUB].[2PLAN] + [GDL].[SYS_SUB].[2PLAN] + [MTY].[SYS_SUB].[2PLAN] + [TIJ].[SYS_SUB].[2PLAN] AS [PLAN2]" & _
"FROM " & _
"[MEX].[SYS_SUB], [GDL].[SYS_SUB], [MTY].[SYS_SUB],[TIJ].[SYS_SUB]" , objCnn
If Not rstPanel.EOF Then
strCategory = ""
%>
<font class="EOPP_TITLETABLE"><%= rstPanel("description").Value %>
<%
If inStr(Session("strIBSCPerm"),"P1") > 0 Then
Response.Write "<a href=""editplan.asp"" class=""PSNAVPARENTLINK"">Edit Plan</a>"
If inStr(Session("strIBSCPerm"),"R1") > 0 Then Response.Write " | "
End If
If inStr(Session("strIBSCPerm"),"R1") > 0 Then
Response.Write "<a href=""editresults.asp"" class=""PSNAVPARENTLINK"">Edit Results</a>"
End If
<%
Do While Not rstPanel.EOF
If rstPanel("title").Value <> strCategory Then
%>
<tr class="EOPP_SCPAGETITLETABLE">
<td width="0" bgcolor="#dbc06e"><%= rstPanel("title").Value %> + <%= rstPanel1("title").Value %> + <%= rstPanel2("title").Value %>
+ <%= rstPanel3("title").Value %></td>
<td width="0" bgcolor="#dbc06e"> </td>
<%
strCategory = rstPanel("title").Value
strCategory = rstPanel1("title").Value
strCategory = rstPanel2("title").Value
strCategory = rstPanel3("title").Value
End If
%>
<td align="center" bgcolor="#fcf9dc"><%= ShowData(rstPanel("1plan").Value + rstPanel1("1plan").Value + rstPanel2("1plan").Value +
rstPanel3("1plan").Value, rstPanel("integer").Value, rstPanel("percent").Value) %></td>
<td bgcolor="#fcf9dc" align="center"><%= ShowData(rstPanel("sem1").Value + rstPanel1("sem1").Value +rstPanel2("sem1").Value
+rstPanel3("sem1").Value, rstPanel("integer").Value, rstPanel("percent").Value) %></td>
<td width="50" bgcolor="#fcf9dc" align="center"><%= ShowResult( rstPanel("1plan").Value + rstPanel1("1plan").Value +
rstPanel2("sem1").Value + rstPanel3("sem").Value, rstPanel("sem1").Value + rstPanel1("sem1").Value +rstPanel2("sem1atual").Value
+rstPanel3("sem1l").Value ,rstPanel("failure").Value, rstPanel("subcategory_id").Value, 1) %></td>
<%
rstPanel.MoveNext
rstPanel1.MoveNext
rstPanel2.MoveNext
rstPanel3.MoveNext
Loop
%>
</table>
<%
Else
%>
<font class="EOPP_GENERALTABLE">A table needs to be selected for the panel showing </font>
<%
End If
rstPanel.Close
rstPanel1.Close
rstPanel2.Close
rstPanel3.Close
Set rstPanel = Nothing
Set rstPanel1 = Nothing
Set rstPanel2 = Nothing
Set rstPanel3 = Nothing
%>
<!--#include file="include\closedbs.asp" --> |