|
-
Feb 22nd, 2002, 11:40 AM
#1
Thread Starter
New Member
Permissions problem with ADO.Net and Access
I am receiving this error when trying to connect to an Access database through OleDB in an ASP.Net application...
The Microsoft Jet database engine cannot open the file 'c:\inetpub\wwwroot\OrderRequest\OrderRequest.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
Here is the code I use...
Private Function GetSalesReps() As Boolean
Dim strConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/OrderRequest/OrderRequest.mdb")
Dim strSQL As String = "SELECT SalesRep FROM SalesReps"
Dim objConnection As New OleDb.OleDbConnection(strConnection)
Dim objCommand As New OleDb.OleDbCommand(strSQL, objConnection)
Try
objConnection.Open()
objConnection = New OleDb.OleDbConnection(strConnection)
objCommand = New OleDb.OleDbCommand(strSQL, objConnection)
drpSalesRep.DataSource = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
drpSalesRep.DataBind()
Catch adoException As Exception
lblException.Text = adoException.Message & adoException.Source
Finally
objCommand = Nothing
objConnection = Nothing
End Try
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|