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
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