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

Database Login

Status
Not open for further replies.

jeffg22

Programmer
Joined
Jan 16, 2003
Messages
4
Location
US
Hi -

I have a VB.NET Windows application that is using CrystalReports.NET. I think I've followed all of the BOL examples and discussion group recommendations, but I'm still getting a database login prompt when running a report. Here's my code for the connection info:

Dim crTableLogonInfo As New TableLogOnInfo
Dim crTables As Tables
Dim crTable As Table

crTables = PeopleList.Database.Tables

For Each crTable In crTables
crTableLogonInfo = crTable.LogOnInfo
crTableLogonInfo.ConnectionInfo.ServerName = strServer
crTableLogonInfo.ConnectionInfo.DatabaseName = strDBPathName
crTableLogonInfo.ConnectionInfo.UserID = strUserID
crTableLogonInfo.ConnectionInfo.Password = strPassword
crTable.ApplyLogOnInfo(crTableLogonInfo)
Next crTable

I've stepped through the code, and all the variables are correct. All of the ConnectionInfo properties are set correctly (and are displayed in the prompt window) except for Password. strPassword is an 8-character string, but ConnectionInfo.Password is an empty string.

When I enter the correct password in the login prompt, the report runs. But, of course, I'd like to get rid of the prompt.

Can anyone see what I'm doing wrong??

Thanks for your help.

- Jeff
 
Of course! As soon as I posted this question, I found the cause of my problem. I apologize to all for taking up bandwidth.

FYI, the issue was that my databasename property was the full path and file name of the SQL data file. (I swear I read somewhere that that was how it should be!) When I changed it to just the database name, the report ran without the prompt.

- Jeff
 
Is your database an access database?
I don't know what to put in for server, userid, and password
as there are none on my access database.
 
Hi susani -

No, sorry, it's not an Access database. I'm using MSDE as my database engine.

Since I've never used CrystalReports with an Access database, I can't offer any helpful guidance.

- Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top