G
Guest
I am trying to open a secured database via .NET. The project worked fine
until I implemented the database security.
(This is in Office 2003 and .NET 2003 on a machine running XP, sp2)
Code:
Public Sub New()
Dim objAppSettings As Specialized.NameValueCollection
objAppSettings = ConfigurationSettings.AppSettings()
Connection = New OleDbConnection( _
"Provider=" & objAppSettings.Item("Provider") & ";" & _
"Data Source=" & objAppSettings.Item("Data Source") & ";" & _
"User ID=" & objAppSettings.Item("User ID") & ";" & _
"Password=" & objAppSettings.Item("Password") & ";" & _
"System database=" & objAppSettings.Item("System database") & ";" & _
"Mode=" & objAppSettings.Item("Mode") & ";" & _
"Persist Security Info=" & objAppSettings.Item("Persist Security Info")
& ";" & _
"Database Locking Mode=" & objAppSettings.Item("Database Locking Mode")
& ";")
objAppSettings = Nothing
End Sub
Where the app.config file has: (password will be encrypted once I get it
working)
<appSettings>
<add key="Provider" value="Microsoft.Jet.OLEDB.4.0" />
<add key="Data Source"
value="C:\Projects\InsVerification\VerifyIns2.mdb" />
<add key="Initial Catalog" value="Nothing" />
<add key="User ID" value="SysAdmin" />
<add key="Password" value="SA37~JF48q" />
<add key="Mode" value="Share Deny None" />
<add key="System database"
value="C:\Projects\InsVerification\Security.mdw" />
<add key="Persist Security Info" value="False" />
<add key="Database Locking Mode" value="1" />
</appSettings>
Now I get the error that the project cannot start because the workgroup file
can't be found or someone else has it open in exclusive mode.
This project is currently on a non-networked pc. No one else has it open. I
have added several users to the workgroup and created shortcuts to the db
with them, then opened several instances at the same time. Multiple users
can't be the problem. The path to the security file is correct. I copied it
from a working shortcut.
What parameter(s) am I missing?
Also, now I get the same error when attempting to run the project but
connected to a non-secured database. Do I have to reinstall office to get rid
of the workgroup?
Thanks for any advice you can provide.
until I implemented the database security.
(This is in Office 2003 and .NET 2003 on a machine running XP, sp2)
Code:
Public Sub New()
Dim objAppSettings As Specialized.NameValueCollection
objAppSettings = ConfigurationSettings.AppSettings()
Connection = New OleDbConnection( _
"Provider=" & objAppSettings.Item("Provider") & ";" & _
"Data Source=" & objAppSettings.Item("Data Source") & ";" & _
"User ID=" & objAppSettings.Item("User ID") & ";" & _
"Password=" & objAppSettings.Item("Password") & ";" & _
"System database=" & objAppSettings.Item("System database") & ";" & _
"Mode=" & objAppSettings.Item("Mode") & ";" & _
"Persist Security Info=" & objAppSettings.Item("Persist Security Info")
& ";" & _
"Database Locking Mode=" & objAppSettings.Item("Database Locking Mode")
& ";")
objAppSettings = Nothing
End Sub
Where the app.config file has: (password will be encrypted once I get it
working)
<appSettings>
<add key="Provider" value="Microsoft.Jet.OLEDB.4.0" />
<add key="Data Source"
value="C:\Projects\InsVerification\VerifyIns2.mdb" />
<add key="Initial Catalog" value="Nothing" />
<add key="User ID" value="SysAdmin" />
<add key="Password" value="SA37~JF48q" />
<add key="Mode" value="Share Deny None" />
<add key="System database"
value="C:\Projects\InsVerification\Security.mdw" />
<add key="Persist Security Info" value="False" />
<add key="Database Locking Mode" value="1" />
</appSettings>
Now I get the error that the project cannot start because the workgroup file
can't be found or someone else has it open in exclusive mode.
This project is currently on a non-networked pc. No one else has it open. I
have added several users to the workgroup and created shortcuts to the db
with them, then opened several instances at the same time. Multiple users
can't be the problem. The path to the security file is correct. I copied it
from a working shortcut.
What parameter(s) am I missing?
Also, now I get the same error when attempting to run the project but
connected to a non-secured database. Do I have to reinstall office to get rid
of the workgroup?
Thanks for any advice you can provide.