Re: HELP! Can't change crystal report database source dynamically!
- From: "andy" <aon14@xxxxxxxxxxx>
- Date: 24 Jan 2006 04:54:25 -0800
The connection you initially set the report up with must use windows
security if you're to use that or sql if you're using a specific user.
It doesn't seem to work if you try switching dynamically.
Or at least I couldn't get it to.
This uses windows security.
Stick a user and password in if that's not what you want.
Dim MyTableLogOnInfo As New TableLogOnInfo
Dim MyDBConnectionInfo As New ConnectionInfo
'-----------
Dim log As TableLogOnInfo
Dim tbl As Table
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
.ServerName = "Server"
.DatabaseName = "Database"
.UserID = String.Empty
.Password = String.Empty
End With
For Each tbl In myreport.Database.Tables
log = tbl.LogOnInfo
log.ConnectionInfo = crConnectionInfo
tbl.ApplyLogOnInfo(log)
tbl.Location =
tbl.Location.Substring(tbl.Location.LastIndexOf(".") + 1)
Next
.
- References:
- Prev by Date: Zoom crystal report
- Next by Date: Re: Data Missing Question
- Previous by thread: HELP! Can't change crystal report database source dynamically!
- Next by thread: Re: HELP! Can't change crystal report database source dynamically!
- Index(es):
Relevant Pages
|