I tried this, but got the same error. One thing I should mention is that this is a free table, not part of a .dbc.
I did notice in the Crystal help file that they recommend using the ConnectionProperty Object. I tried this also, but when I tried to set the "Initial Catalog" property, I received this error:
OLE exception error: Exception code e06d7363. OLE object may be corrupt.
Here is how I attempt to set the properties:
*' Get the first table in the report.
DBTable = oCrReport.Database.Tables(1)
*' Get the "Data Source" property from the
*' ConnectionProperties collection.
CPProperty = DBTable.ConnectionProperties("Data Source")
*' Set the new data source (server name).
CPProperty.Value = "c:\temp"
*' Get the "User ID" property from the
*' ConnectionProperties collection.
CPProperty = DBTable.ConnectionProperties("User ID")
*' Set the user name.
CPProperty.Value = ""
*' Get the "Password" property from the
*' ConnectionProperties collection.
CPProperty = DBTable.ConnectionProperties("Password")
*' Set the password.
CPProperty.Value = ""
*' Get the "Initial Catalog" (database name) property from the
*' ConnectionProperties collection.
CPProperty = DBTable.ConnectionProperties("Initial Catalog")
*' Set the new database name.
CPProperty.Value = "TableName" * THIS IS WHERE THE ERROR OCCURS
* Change the location of the data.
DBTable.location = "full path of table"
Thanks,
Rod
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only