
Error setting data source to SQL server
I have written the following code to set the data source to SQL server
in
Crystal Report.
Dim CPProperties As CRAXDRT.ConnectionProperties
Dim CPProperty As CRAXDRT.ConnectionProperty
Dim DBTable As CRAXDRT.DatabaseTable
Dim sTableName As String
Dim sCommand As String
Dim iTabCount As Integer
Dim iCount As Integer
On Error GoTo ErrHdlr_Set
iTabCount = m_oReport.Database.Tables.Count
For iCount = 1 To iTabCount
' Get the first table in the report.
Set DBTable = m_oReport.Database.Tables(iCount)
'retrieve the table name
sTableName = DBTable.Name
' Get the collection of connection properties.
Set CPProperties = DBTable.ConnectionProperties
CPProperties.DeleteAll
CPProperties.Add "DLLName", "crdb_ado.dll"
CPProperties.Add "Provider", "SQLOLEDB"
CPProperties.Add "Server", "TEST"
CPProperties.Add "Database", "TEST DATABASE"
CPProperties.Add "Integrated Security", "True"
DBTable.Location = "TEST"
Next iCount
where test is the table name. Whenever I run to this line
DBTable.Location = "TEST" I get this error: Database dll crdb_ado.dll
could not be loaded. Any idea why this is happening?
Thank you.