What is a connection string to sdf in Common Files Folder?
Posted on 2014-10-05
My Desktop Windows (X86) Application failed on Vista and XP machines because I had an sdf in the Program Files and/or Program Files (x86) folder that was accessed using the connection string:
Dim getSW As New SqlCeConnection("Data Source =" & Application.StartupPath & "\Volume Tables\Softwood\" & lblSW.Text & ".sdf")
That was throwing an error because permissions do not exist.
Since these files will be shared, I assume that I should drop the folder and files into the Common Files Folder for it to work: Feel free to correct me if I am wrong. I have done that using the File System component and it works as far as install goes. What I do not know is how to write a connection string to the location. I tried:
Dim getSW As New SqlCeConnection("Data Source =" & Application.CommonAppDataPath & "\Volume Tables\Softwood\" & lblSW.Text & ".sdf")
It does not work. I do not know how to connect to the files in the Common Files Folder. And even if I can connect will users still be locked out from reading sdf files in that location? There is no write access required.
How do I fix this? Using Compact Server 3.5 SP2.