Development Environment: WinXP, Visual Basic 6, Crystal Reports 9, SQL Server 2000
Using the following VB code I am opening a Crystal Reports .RPT report. Which I then set the required connection properties for the report. As you can see the code/report currently uses a File DSN. I would like to change this to a DSN-Less Connection. But I seem to be unable to figure out the correct CR9 code syntax for a DSN-Less connection.
Anyone know how I can accomplish this?
Set CrApplication = New Application
Set CrReport = CrApplication.OpenReport(App.Path & "\Reports\Detail.rpt", 1)
CrReport.Database.Tables(1).ConnectionProperties.Item("FileDSN" = "C:\Program Files\Common Files\ODBC\Data Sources\MMHS_DB.dsn"
CrReport.Database.Tables(1).ConnectionProperties.Item("database" = DBConnString.Database
CrReport.Database.Tables(1).ConnectionProperties.Item("password" = DBConnString.Password
CrReport.Database.Tables(1).ConnectionProperties.Item("user ID" = DBConnString.UserID
CrReport.DiscardSavedData
CrReport.SQLQueryString = "SELECT * " & _
"FROM vw_CLAIM " & _
"WHERE APPLICATION_ID = " & gAPPLICATION_ID & " AND CLAIM_ID = " & gClaimId & " " & _
"ORDER BY NAME;"
Using the following VB code I am opening a Crystal Reports .RPT report. Which I then set the required connection properties for the report. As you can see the code/report currently uses a File DSN. I would like to change this to a DSN-Less Connection. But I seem to be unable to figure out the correct CR9 code syntax for a DSN-Less connection.
Anyone know how I can accomplish this?
Set CrApplication = New Application
Set CrReport = CrApplication.OpenReport(App.Path & "\Reports\Detail.rpt", 1)
CrReport.Database.Tables(1).ConnectionProperties.Item("FileDSN" = "C:\Program Files\Common Files\ODBC\Data Sources\MMHS_DB.dsn"
CrReport.Database.Tables(1).ConnectionProperties.Item("database" = DBConnString.Database
CrReport.Database.Tables(1).ConnectionProperties.Item("password" = DBConnString.Password
CrReport.Database.Tables(1).ConnectionProperties.Item("user ID" = DBConnString.UserID
CrReport.DiscardSavedData
CrReport.SQLQueryString = "SELECT * " & _
"FROM vw_CLAIM " & _
"WHERE APPLICATION_ID = " & gAPPLICATION_ID & " AND CLAIM_ID = " & gClaimId & " " & _
"ORDER BY NAME;"