Information générale
Catégorie:
Crystal Reports
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement