Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.Net ASP Error Trying to open Access DB

Status
Not open for further replies.

jgsteeldev

Programmer
Feb 5, 2004
30
0
0
US
Code:
The Microsoft Jet database engine cannot open the file 'C:\DBName.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

Does anybody know why this is happening?

Here is the code.

Code:
 Dim silpadaConn As OleDbConnection = New OleDbConnection("Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
        "ocking Mode=1;Jet OLEDB:Database Password=;Data Source=""C:\DBName.mdb"";Password=;Jet OLEDB:Engine Type=5;Jet OLEDB:Global Bulk T" & _
        "ransactions=1;Provider=""Microsoft.Jet.OLEDB.4.0"";Jet OLEDB:System database=;Jet " & _
        "OLEDB:SFP=False;Extended Properties=;Mode=Share Deny None;Jet OLEDB:New Database" & _
        " Password=;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy Locale on" & _
        " Compact=False;Jet OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet " & _
        "OLEDB:Encrypt Database=False")

        Dim selectCMD As OleDbCommand = New OleDbCommand("SELECT intPersonID, txtEmail, txtFirstName, txtLastName, txtPhone, txtWebsite FRO" & _
        "M tblContacts", silpadaConn)

        selectCMD.CommandTimeout = 30

        Dim custDA As OleDbDataAdapter = New OleDbDataAdapter
        custDA.SelectCommand = selectCMD

        Dim custDS As DataSet = New DataSet
        custDA.Fill(custDS, "tblContacts")
        DataGrid1.DataSource = custDS
        DataGrid1.DataMember = "tblContacts"
        DataGrid1.DataBind()

Here we go Royals! Here we go!!!!!
 
You probably haven't set the relevant permissions for the ASPNET account.

Also, there is an ASP.NET forum (forum855) which is more relevant for your post.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top