Access database authentication

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
 
K

Ken Cox [Microsoft MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top