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!

Help Dynamically connecting to Access Database table

Status
Not open for further replies.

chadau

Programmer
Nov 14, 2002
155
US
I am using VB.NET to dynamically set the location of the database table for a Crystal report. The following code does what I need, but everytime the report loads, a server logon screen pops up, I click FINISH and the report is displayed. I would like to know if there is a way around that login screen?

Dim logOnInfo As New TableLogOnInfo()

logOnInfo = crpt.Database.Tables.Item
("tblMostPopular").LogOnInfo

'Set the connection information for the table in the report.

logOnInfo.ConnectionInfo.ServerName = GetDBPath() & "EmailReporting.mdb"

logOnInfo.ConnectionInfo.DatabaseName = "EmailReporting.mdb"
logOnInfo.ConnectionInfo.UserID = "Admin"
logOnInfo.ConnectionInfo.Password = ""
logOnInfo.TableName = "tblMostPopular"
logoninfo.ReportName = "MostPopular.rpt"
crpt.Database.Tables.Item("tblMostPopular").ApplyLogOnInfo(logoninfo)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top