Crystal Report cannot logon sql server!!??

A

abc

Our web project is used VS2003 and Crystal Reports for Visual Studio.NET.
There have reports that directly call to sql server's stored procedure. I
also call SetDatabaseLogon method to change user id and password. But I
found the crystal reports use ASPNET account to logon SQL Server, not my
expected user id. Our SQL Server is MSDE and run on mixed authenitcation
mode.
 
G

Guest

Hi ABC,


You need to loop through every table in the report to logon:


TableLogOnInfo logOnInfo = new TableLogOnInfo ();
int i = 0;

// Loop through every table in the report.
for (i=0;i == Report.Database.Tables.Count - 1;i++)
{
// Set the connection information for the current table.
logOnInfo.ConnectionInfo.ServerName = serverNameTxt.Text;
logOnInfo.ConnectionInfo.DatabaseName = dbNameTxt.Text;
logOnInfo.ConnectionInfo.UserID = userNameTxt.Text;
logOnInfo.ConnectionInfo.Password = passwordTxt.Text;
Report.Database.Tables .ApplyLogOnInfo (logOnInfo);
}


HTH

Elton Wng
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top