Avatar of Larry Rungren
Larry Rungren
Flag for United States of America asked on

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=**********")
        dbconn.Open()

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?
Crystal Reports

Avatar of undefined
Last Comment
Larry Rungren

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Mike McCracken

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Larry Rungren

ASKER
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?
Mike McCracken

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.

mlmcc
Larry Rungren

ASKER
Found a good sample that re-enforces your comment   thanks
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck