Access database authentication

  • Thread starter Thread starter James
  • Start date Start date
J

James

I'm having this problem with an ASP.NET web service
(C#)... can anyone help please?

My connection string is:

Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:System
Database=" + Server.MapPath("Secured.mdw") +@"; Data
source=" + Server.MapPath("TMIData.mdb") +@"; User
ID=james; Password=pass; Persist Security Info=true

to access the database through OleDb. The connection is
made with an XML web service.

For some reason, all works fine when the web service is
referenced 'offline' ("using TMI_Webcomm"), but not when
it is called with a web reference ("using
TMI_Management.localhost"), as if it were on a server.

The error occurs when the following code is run:

oleDbDataAdapter1.Fill(this.dataSet1, "Users");

....and the message reads:

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

An unhandled exception of
type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll

Additional information:
System.Web.Services.Protocols.SoapException: Server was
unable to process request. --->
System.Data.OleDb.OleDbException: You do not have the
necessary permissions to use
the 'C:\Inetpub\wwwroot\TMIData.mdb' object. Have your
system administrator or the person who created this
object establish the appropriate permissions for you.
at System.Data.OleDb.OleDbConnection.ProcessResults
(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider
()
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen
(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillFromCommand
(Object data, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, String srcTable)
at TMI_Webcomm.TMIWebcomm.UserAccessLevel(String
UserID, String Password) in c:\inetpub\wwwroot\tmi
webcomm\service1.asmx.cs:line 51

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

I assure you that this is a problem with the user
authentication, as all works fine without database
security. It's also kinda wierd that the problem only
occurs when the web service is called through a web
reference.

Any ideas, anyone????

Please help!

James
 
Does the ASPNET account (or whatever account the Web service runs as) have
write privileges to the folder where the Access database is located? If not,
Access can't create its locking file and things fall apart.
 
Back
Top