DATABASE opens in vb 2010

I have an open  database statement that seems to work when the first window is opened. I thought that this would keep the database open throughout the application.

        Dim dbconn As New SqlConnection
        Dim sqlConn As SqlConnection = New SqlConnection("MCLE_SQL2008\MCLE_SQL2008;Initial Catalog=iMIS_MCLE_Prod;User ID=sa;Password=**********")

I have a form that contains a Crystal viewer and a Crystal Report.  The report will run correctly, but it prompts for the sa password when you refresh the report manually. If the database is open already, why does it prompt again, and is there a way to eliminate this?
Larry RungrenDirector of TechnologyAsked:
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.

Crystal uses its own database connection not the one that is in the application,

There is a method you can use to create the recordset in the application then pass it to the report. 


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
Larry RungrenDirector of TechnologyAuthor Commented:
I'm not using ADO.  The Crystal report as it exists runs quite nicely from VB6... Iknow, Iknow old technology....but it work with minimal pain.

Does this mean the report has to be re-written to accommodate VB 2010?

I just can't see giving the sa password to staff.

Is there a way to pas the database access method to the CR?
Missed it was on the refresh.

The refresh causes a postback which you have to handle.
I don't know how to handle it but I know you have to save the user/password in session variables.

Larry RungrenDirector of TechnologyAuthor Commented:
Found a good sample that re-enforces your comment   thanks
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.