Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting subscript out of range error in VB when connecting to Crystal

Status
Not open for further replies.

mpodlesny

Programmer
Mar 23, 2005
24
US
I am running the code below and get a "subscript out of range" error on the line:
crTable.ConnectionProperties("Server") = "orcl"

Any ideas?


===================================================
Dim crTable As CRAXDRT.DatabaseTable


'Open the report
Set crxRpt = crxApp.OpenReport(App.Path & "\CRXI_protocolinformation.rpt")


'Clear any saved data to force to report to read from the db
crxRpt.DiscardSavedData

'Set login information for the report here, if necessary
For Each crTable In crxRpt.Database.Tables
' Set the logon information (ODBC to Oracle)
crTable.ConnectionProperties("Server") = "orcl"
crTable.ConnectionProperties("user id") = "alimsmaster"
crTable.ConnectionProperties("password") = "alimsmaster"

' Fully qualify the table location
'crtable.Location = "SCHEMA NAME." + crtable.Location
Next crTable

'View the report
CRViewer1.ReportSource = crxRpt
CRViewer1.ViewReport
 
Server" isn't a valid ConnectionProperties attribute. Try "DSN" if you're using ODBC.

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top