Hello,
I have some VBA code that establishes an ADODB.Connection. Is there any way I can use that ADODB.Connection to log on and refresh a Crystal report?
Below is my ADODB code where I establish a "Cn" variable containing the ADODB connection parameters. What I was hoping to do is use this ADODB connection to refresh a Crystal.
Conn = "DSN=<dsn name>;DBNAME=<dbname>"
Set Cn = New ADODB.Connection
Cn.Properties("Prompt") = adPromptComplete
With Cn
.ConnectionString = Conn
.CursorLocation = adUseClient
.Open
End With
...
Then I hope to use above ADODB connection to log on and refresh an existing Crystal? I know how to open a Crystal and then am trying to use the following code to log on. Variable crxTable is a table in the Crystal report that I'm trying to refresh.
With crxTable.ConnectionProperties
.Item("DSN") = <DSN name>
.Item("VendorType") = <vendor type>
.Item("User ID") = <userID>
.Item("Password") = <password>
'End With
I have some VBA code that establishes an ADODB.Connection. Is there any way I can use that ADODB.Connection to log on and refresh a Crystal report?
Below is my ADODB code where I establish a "Cn" variable containing the ADODB connection parameters. What I was hoping to do is use this ADODB connection to refresh a Crystal.
Conn = "DSN=<dsn name>;DBNAME=<dbname>"
Set Cn = New ADODB.Connection
Cn.Properties("Prompt") = adPromptComplete
With Cn
.ConnectionString = Conn
.CursorLocation = adUseClient
.Open
End With
...
Then I hope to use above ADODB connection to log on and refresh an existing Crystal? I know how to open a Crystal and then am trying to use the following code to log on. Variable crxTable is a table in the Crystal report that I'm trying to refresh.
With crxTable.ConnectionProperties
.Item("DSN") = <DSN name>
.Item("VendorType") = <vendor type>
.Item("User ID") = <userID>
.Item("Password") = <password>
'End With