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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error connecting to report from VB

Status
Not open for further replies.

anet

Programmer
Jul 10, 2001
35
CA
I am using VB6, CR 4.6 and Access 2000 and I think there is a discrepancy in my database connection.

My global variable in my vb project is:
Code:
Set myConn = New ADODB.Connection
strDataSource = App.Path & "\InventoryV1.mdb"
With myConn
.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDataSource &";Persist Security Info=False"
.CursorLocation = adUseClient
.Open
End With
This connection is working for inserting, deleting, updating, etc. but I can't preview my Crystal Reports. It may have something to do with the way I set up my database connection in Crystal. I tried to use the Data File option, but it kept asking me for an Access password (there isn't a password so I just clicked cancel, then it told me my .mdb file is "not a known database type") so then I selected ODBC/SQL and set up my report and it works fine in Crystal. However, when I try to preview it from my VB program I get the following error:
Runtime error:20536 - Unable to Connect, incorrect logon parameters.
If I run the program in debug I can see that it craps out at the line crReport.Action = 1

How can I fix this? Thanks.
 
Additional Information: when I debug, the error that comes up at crReport.Action = 1 after the cannot connect error is:
.Action=<property is write only>

Help!!! This is driving me crazy!

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top