Link to home
Start Free TrialLog in
Avatar of leezone
leezone

asked on

Install problem when face UAC

Hi

I'm an application developer, the program that I design was in .Net Framework 2.0 and I was using WS 2005 for VB and SQL Express to develop my application. My application will base on application start up path to attach the database and get some application setting and it was run perfect on XP and WIN server 2003 but recently I have few client that use Vista (All Edition) or WIN Server 2008 (All edition) was unable to run my application.

The problem was occur under UAC setting, one they turn on the UAC, the application that install under C:\Program Files\My Application\ will also create under Users\User\AppData\Local\VirtualStore\Program Files\My Application and window will always point to Users folder to get the database file and setting which my default was select the database file on application startup patch.

Can any one help on me on this issue?

Thank
Avatar of leezone
leezone

ASKER

bottom is how i connect to database
If is local user the connection string will be
 
strConnection = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|MyApplication.mdf;Integrated Security=True;Connect Timeout=30;User Instance=false"
 
If is network then connection string will be
 
            Dim dtServer As New DataTable
            Dim lDataset As New DataSet
            Dim ExportPath As String = Application.StartupPath & "\FMerge_Info.lic"
            Dim fs As New FileStream(ExportPath, FileMode.Open)
 
            gf_LoadNetworkConnectionbutton = True
            'Read import data from xml
            lDataset.ReadXml(fs)
            fs.Close()
 
            dtServer = lDataset.Tables(lDataset.Tables.IndexOf("M_FinmergeServer"))
            If dtServer.Rows.Count > 0 Then
                With dtServer.Rows(0)
                    myServer.IsNetwork = .Item(0)
                    myServer.ServerName = .Item(1).ToString
                    myServer.UserId = .Item(2).ToString
                    myServer.UserPassword = .Item(3).ToString
                End With
 
                If myServer.ServerName <> "" Then
                    strConnection = "Data Source=" & myServer.ServerName & ";Initial Catalog=" & strDbFilename & _
                                    ";User ID=" & myServer.UserId & ";Password=" & myServer.UserPassword
 
                    If CheckConnectionString(strConnection) = False Then
                        gf_LoadNetworkConnectionbutton = False
                        gclsError.gf_ErrorHandler("TestConnectionFailed", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Error, False)
                    End If
                Else
                    gf_LoadNetworkConnectionbutton = False
                End If
            End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leezone
leezone

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial