Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: ASP crystal reports from multiple tables


Message #1 by "hamesh Tiwari" <h_tiwari@h...> on Sat, 7 Apr 2001 19:32:06 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_003C_01C0BF99.6DD8CC40

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Hai all

I want to integrate already existing reports in CR6 with ASP .My 

database is SQL Server 7 being accessed through odbc dsn.

For those who already know this i'd like to extend this a bit further 

again.

It gives an error message "Cpeaut32 error 800a5085".I've still not got a 

solution to this . Any one got a clue ? .

    The problem is If I have to extract data from a single table the =3D

report is being displayed properly but If I am trying to extract data 

=3D

from multiple tables related heirarchically and I am mentioning the =3D

various joins in the session recordset to be passes to RPTSERVER then it 

=3D

gives an error

cpeaut32 error '800a5085'



Checking for data source changes failed.=3D



The error is encountered when I'm giving readrecords with session(report 

object)



The code which i'm using is as follows  :-



<%@ LANGUAGE=3D"VBSCRIPT" %>

<%

Set oConn =3DServer.CreateObject("ADODB.Connection")

   my_DSN =3Dsome dsn

   DBDSN =3D"DSN=3D"+some dsn+";uid=3Dsa;pwd=3Dsql"

   oConn.open DBDSN

set session("oRs") =3DServer.CreateObject("ADODB.Recordset")

session("oRs").ActiveConnection =3DoConn

q=3Dquery with multiple field select and multiple join condition

session("oRs").Open q

rs.Open q



reportname =3Dsome report



If Not IsObject (session("oApp")) Then

Set session("oApp") =3DServer.CreateObject("Crystal.CRPE.Application")

End If



Path =3DRequest.ServerVariables("PATH_TRANSLATED")

While (Right(Path, 1) <> "\" And Len(Path) <> 0)

iLen =3DLen(Path) - 1

Path =3DLeft(Path, iLen)

Wend



If IsObject(session("oRpt")) then

 Set session("oRpt") =3Dnothing

 Set Rp =3Dnothing

End if



Set session("oRpt") =3Dsession("oApp").OpenReport(path&reportname, 1)



session("oRpt").DiscardSavedData



set session("ParamCollection") =3DSession("oRpt").Parameterfields



set Database =3Dsession("oRpt").Database



set Tables =3DDatabase.Tables



'set Table1 =3DTables.Item(1)

'set Table2 =3DTables.Item(2)

'set Table3 =3DTables.Item(3)

'set Table4 =3DTables.Item(4)

'set Table5 =3DTables.Item(5)

'set Table6 =3DTables.Item(6)



'Table1.SetPrivateData 3, session("oRs")

'Table2.SetPrivateData 3, session("oRs")

'Table3.SetPrivateData 3, session("oRs")

'Table4.SetPrivateData 3, session("oRs")

'Table5.SetPrivateData 3, session("oRs")

'Table6.SetPrivateData 3, session("oRs")



On Error Resume Next

session("oRpt").ReadRecords

If Err.Number <> 0 Then

  Response.Write "An Error has occured on the server in attempting to 

=3D

access the data source"

Else

  If IsObject(session("oPageEngine")) Then

   set session("oPageEngine") =3Dnothing

  End If

set session("oPageEngine") =3Dsession("oRpt").PageEngine

End If



Response.Redirect("rptserver.asp")



%>

















  Return to Index