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?  

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
How are you specifying the datasource for the Crystal Report?

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.

Bob LearnedCommented:
Good point, Mike!!

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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...

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.

        '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



    End Sub

        CrystalReportViewer1.ReportSource = CRReport
strong-danielAuthor Commented:

PAQed with points refunded (500)

EE Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.