Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cpeaut error Cannot open SQL server

Status
Not open for further replies.

warner

Programmer
Nov 24, 2000
16
GB
Running CRPEApplicaton from within asp page , getting error as above, error traced to call objReport.Export(false) line in script. Any ideas how to stop this error?
 
some more detail, calling report through asp page with vbscript.

code as follows

strTargetPath = Application("ReportTargetPath") & Session("strUserId") & "\"

Set objFileSystem = CreateObject("Scripting.FileSystemObject")

strSourceFile = Application("ReportSourcePath") & Session("reportid") & ".rpt"

strTargetFile = strDesc & "-" & datepart("yyyy",now) & datepart("m",now) & datepart("d",now) & "-" & datepart("h",now) & datepart("n",now) & datepart("s",now) & ".rpt"

strReportURL = Application("ReportURL") & Session("strUserId") & "/" & strTargetFile

strTargetFile = strTargetPath & strTargetFile
'--- create crystal application ---
'Response.Write(&quot;Starting Crystal Reports...<P>&quot;)
Set objReportApp = CreateObject(&quot;Crystal.CRPE.Application&quot;)


Call objReportApp.LogOnServer(&quot;p2sodbc.dll&quot;,Application(&quot;dbname&quot;),&quot;&quot;, &quot;sa&quot;, &quot;support&quot;)


Set objReport = objReportApp.OpenReport(strSourceFile)


Response.Write &quot;server:&quot; & Application(&quot;dbname&quot;)
objReport.Database.Parameters(1).Value = Session(&quot;Applicationno&quot;)
objReport.Database.Parameters(2).Value = strclass
Response.Write &quot;application:&quot; & session(&quot;applicationno&quot;)
Response.Write &quot;permitclass:&quot; & strclass

'--- set report destination ---
objReport.ExportOptions.DestinationType = 1 'crEDTDiskFile
objReport.ExportOptions.FormatType = 1 'crEFTCrystalReport
objReport.ExportOptions.DiskFileName = strTargetFile
objReport.ProgressDialogEnabled = false
Response.Write &quot; target file:&quot; & strtargetfile
call objReport.Export(false)

Set objReport = Nothing
Set objParameter = Nothing


Call objReportApp.LogOffServer(&quot;p2sodbc.dll&quot;, Application(&quot;dbname&quot;), &quot;&quot;, &quot;sa&quot;, &quot;support&quot;)
'objReportApp.close
Set objReportApp = Nothing


this is pretty urgent.
 
No never got an answer.

As i remember in the end came down to crystal reports storing data connection info within the report itself

refreshing the odbc link worked occasionally.

other than that problem sometimes caused by unscheduled server crashes, try rebooting the web server the project is on.

dont know if this will be any help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top