Foros del Web » Programando para Internet » ASP Clásico »

Apertura De 4 Bd Desde Asp

Estas en el tema de Apertura De 4 Bd Desde Asp en el foro de ASP Clásico en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 13/06/2008, 18:19
 
Fecha de Ingreso: junio-2008
Mensajes: 5
Antigüedad: 16 años, 10 meses
Puntos: 0
Apertura De 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 pero que 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
  #2 (permalink)  
Antiguo 13/06/2008, 18:26
Avatar de u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 3 meses
Puntos: 98
Respuesta: Apertura De 4 Bd Desde Asp

Hola BLACKCOPV, en realidad solo necesitarias un recordset y una conexion y ver que tu query realmente regrese la salida correcta, no se que mas decirte porque no proporcionas mas datos.

Saludos
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway
  #3 (permalink)  
Antiguo 13/06/2008, 19:19
 
Fecha de Ingreso: junio-2008
Mensajes: 5
Antigüedad: 16 años, 10 meses
Puntos: 0
Respuesta: Apertura De 4 Bd Desde Asp

HOLA U_GOLDMAN GRACIAS POR TU PRONTA RESPUESTA ESTO ES LO FALTANTE DE PARTE DEL CODIGO YA QUE ES INMENSO CRES QUE CON ESTO ME PODRIAS APOYAR PORFAVOR Y NUEVAMENTE GRACIAS.
If Not rstPanel.EOF Then

strCategory = ""

%>
<font class="EOPP_TITLETABLE"><%= rstPanel("description").Value %>


<%


If inStr(Session("Perm"),"P1") > 0 Then



Response.Write "<a href=""plan.asp"" class=""PSNAVPARENTLINK"">Plan</a>"
If inStr(Session("CPerm"),"R1") > 0 Then Response.Write "&nbsp;|&nbsp;"

End If

If inStr(Session("Perm"),"R1") > 0 Then

Response.Write "<a href=""results.asp"" class=""PSNAVPARENTLINK"">Edit Results</a>"

End If


<%

Do While Not rstPanel.EOF

If rstPanel("title").Value <> strCategory Then
%>



<%

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("1plan").Value + rstPanel3("1plan").Value, rstPanel("sem1").Value + rstPanel1("sem1").Value +rstPanel2("sem1l").Value +rstPanel3("sem1").Value ,rstPanel("failure").Value, rstPanel("cat_id").Value, 1) %></td>

<td align="center" bgcolor="#fcf9dc"><%= ShowData(rstPanel("2plan").Value + rstPanel1("2plan").Value + rstPanel2("2plan").Value + rstPanel3("2plan").Value, rstPanel("integer").Value, rstPanel("percent").Value) %></td>
<td bgcolor="#fcf9dc" align="center"><%= ShowData(rstPanel("sem2").Value + rstPanel1("sem2").Value +rstPanel2("sem2").Value +rstPanel3("sem2").Value, rstPanel("integer").Value, rstPanel("percent").Value) %></td>
<td width="50" bgcolor="#fcf9dc" align="center"><%= ShowResult( rstPanel("2plan").Value + rstPanel1("2plan").Value + rstPanel2("2plan").Value + rstPanel3("2plan").Value, rstPanel("sem2").Value + rstPanel1("sem2").Value +rstPanel2("sem2").Value +rstPanel3("sem2").Value ,rstPanel("failure").Value, rstPanel("cat_id").Value, 2) %></td>

rstPanel.MoveNext
rstPanel1.MoveNext
rstPanel2.MoveNext
rstPanel3.MoveNext

Loop

%>
</table>
<%

Else

%>

<font class="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


%>
  #4 (permalink)  
Antiguo 14/06/2008, 12:33
 
Fecha de Ingreso: julio-2004
Mensajes: 76
Antigüedad: 20 años, 9 meses
Puntos: 0
Respuesta: Apertura De 4 Bd Desde Asp

Que tipo de error te da? Alguna linea en particular?
__________________
Ama Martire
________________________
Hospedaje Windows & Unix Multidominio

"Si no puedes resolverlo.....evitalo"
  #5 (permalink)  
Antiguo 16/06/2008, 10:16
 
Fecha de Ingreso: junio-2008
Mensajes: 5
Antigüedad: 16 años, 10 meses
Puntos: 0
Pregunta 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 "&nbsp;|&nbsp;"
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">&nbsp;</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" -->
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:52.