[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1414
  • Last Modified:

Add DSN to Web.config...

Network admins told me I can't add DSN's to their server that my web application will run off.

I have added a connectionstring to the web.config...  but stupid Crystal Reports want a DSN.  This is dealing with a secured Access Database (IE using system database in connection string that points to the security workgroup file).  

I am trying to use Crystal Reports.

My question is:  Do I add a DNS as a variable in the web.config and connect to crystal reports that way?  

I have read that Business Objects messed up with the Crystal Reports version that comes with VS2005 and the left off in the logoninfo the system database parameter.  I can get these reports working on my local machine, but it doesn't work when I deploy it to the development web server.   It wants the DNS.

How do I point Crystal Report to use the connection string or DNS in my web.config file?  

0
strong-daniel
Asked:
strong-daniel
1 Solution
 
Bob LearnedCommented:
How are you specifying the datasource for the Crystal Report?

Bob
0
 
mlmccCommented:
You don't have to use a dsn for Crystal.  You can connect to the database directly.

Any particular reason for using a DSN?
DSNs have to be added with admin privileges so there is no way to add it through the application.


mlmcc
0
 
Bob LearnedCommented:
Good point, Mike!!

Bob
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
strong-danielAuthor Commented:
Business Objects did not make it easy to connect to a secured Access DB.  It is driving me nuts.

I need to connect to several secured Access DB's...  Secured Access DB's require an extra property... the SystemDatabase property... which points to the .mdw file.  (Workgroup security file for Access)

If you can tell me how to easily do that, I will give anyone the points.  So far, after searching and searching the web., there isn't a way.   Please tell if you know or have any ideas...

0
 
strong-danielAuthor Commented:
     
This is the code I use to connect non secured Access DB's...  

However, Business Objects left the SystemDatabase property out of the connectioninfo....


 Dim CRReport As ReportDocument

        CRReport = New ReportDocument
        Dim reportPath As String = Server.MapPath("CrystalReport1.rpt")

        'Loads a new report. If a report is already loaded, then it is closed and a new one is opened.
        CRReport.Load(reportPath)

        'Don't allow the user to enter the login information
        CrystalReportViewer1.EnableDatabaseLogonPrompt = False

        'Set up an object to use the connecton info
        Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()

       
        'Set the DatabaseName, UserID, and Password properties of the ConnectionInfo instance.


        myConnectionInfo.DatabaseName = "dbname"
        myConnectionInfo.UserID = "userid"
        myConnectionInfo.Password = "mypassword"


        SetDBLogonForReport(myConnectionInfo, CRReport)


   Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)


        'Tables is an indexed class that contains instances of the Table class.
        Dim myTables As Tables = myReportDocument.Database.Tables

        'Create a foreach loop that loops through each Table instance in the Tables indexed class instance.
        For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables

   
            Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo

       
            myTableLogonInfo.ConnectionInfo = myConnectionInfo

 
            myTable.ApplyLogOnInfo(myTableLogonInfo)

        Next

    End Sub
   

        CrystalReportViewer1.ReportSource = CRReport
0
 
strong-danielAuthor Commented:
Thanks...

0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now