Opening Crystal Reports designed using the Crystal Reports 10 in VB.Net

Gousi

New member
Joined
Nov 17, 2004
Messages
3
Programming Experience
1-3
Need Resolution for the following Error occured while running the Crystal Report.

Logon failed. Details: 01000:[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). Query Engine Error: '08001:[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.' Logon failed. Error in File C:\DOCUME~1\User1\ASPNET\LOCALS~1\Temp\{57C4DB29-ACB9-438D-96FE-99FBC3631C3B}.rpt: Unable to connect: incorrect log on parameters.

Steps that we followed to run the Report:

DSN Used(Server Name): LocalServer
Database Used: Tempdb
User Name: sa
Password: ""

From this table i have inserted a table to the report and placed the field in the report. After this I run the VB.Net coding but i am getting the above error. Sometime with the Same coding it is working fine.

I am suspecting whether ODBC Driver might be a problem. can anyone provide solution for this.

Code used:

Dim ConnectionInfo AsNew CrystalDecisions.Shared.ConnectionInfo
Dim TableLogOnInfo As CrystalDecisions.Shared.TableLogOnInfo
Dim dfdoDiskOptions AsNew DiskFileDestinationOptions
Dim eoExportOptions AsNew ExportOptions
Dim HasSubReport AsBoolean
MainReport.Load(ReportPath, OpenReportMethod.OpenReportByTempCopy)
dfdoDiskOptions.DiskFileName = "C:\temppdf.pdf"

ConnectionInfo.AllowCustomConnection = True
ConnectionInfo.ServerName = "LocalServer"
ConnectionInfo.DatabaseName = "Tempdb"
'ConnectionInfo.UserID = "sa"
'ConnectionInfo.Password = ""
Dim T As CrystalDecisions.CrystalReports.Engine.Table
ForEach T In MainReport.Database.Tables
TableLogOnInfo = T.LogOnInfo
TableLogOnInfo.ConnectionInfo = ConnectionInfo
T.ApplyLogOnInfo(TableLogOnInfo)
T.Location = ConnectionInfo.DatabaseName & ".dbo." & T.Location.Substring(T.Location.LastIndexOf(".") + 1)
Next
EndIf
With MainReport
eoExportOptions = .ExportOptions
With eoExportOptions
.ExportFormatType = ExportFormatType.PortableDocFormat
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportDestinationOptions = dfdoDiskOptions
EndWith
.Export()
EndWith

-- Gousi


 

jimmlegs

New member
Joined
Aug 30, 2005
Messages
1
Programming Experience
5-10
Have you found a solution

Sorry to bother you but I am getting the same error. My company just upgraded from MSSQL 7 to 2000 and our association management database and this issue has been plaguing us ever since.

Any information would be most appreciated.

Thanks
 
Top Bottom