I have a project consisting of a Web application and a Web service. The Web
application calls the Web service to do some modifications in a database (
Microsoft Access ) When the OleDbConnection.Open function is called I receive
the followin message:
[SoapException: System.Web.Services.Protocols.SoapException: Server was
unable to process request. ---> System.Data.OleDb.OleDbException: Unspecified
error
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at NED.CablesDBUpdate.DeleteRow(DataSetNewCables dsNewCables) in
c:\inetpub\wwwroot\nedservice\cablesdbupdate.asmx.cs:line 258
at NED.CablesDBUpdate.DBHandler(DBActions Action, DataSetNewCables
dsNewCables) in c:\inetpub\wwwroot\nedservice\cablesdbupdate.asmx.cs:line 224
at NED.CablesDBUpdate.DeleteCable(DataSetNewCables dsNewCables) in
c:\inetpub\wwwroot\nedservice\cablesdbupdate.asmx.cs:line 177
--- End of inner exception stack trace ---]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
NED.NEDService.CablesDBUpdate.DeleteCable(DataSetNewCables dsNewCables)
in C:\Inetpub\wwwroot\NED\Web References\NEDService\Reference.cs:80
NED.PNG.QueryFrm.grdNewCables_DeleteCommand(Object source,
DataGridCommandEventArgs e) in C:\Inetpub\wwwroot\NED\PNG\QueryFrm.aspx.cs:948
System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs
e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
The same behavior when I try to open a SQL database. When I call the same
function from the Web application everything works!!!!
Has anyone any idea what it may be wrong?
Thanks in advance for your help
Hi
What connect string are you using (please hide passwords)... If this works
from a windows application but not from a web service, first thoughts lean
towards security or identity. The error signifies that the call to connect
has thrown an error that was not trapped. This typically happens if the
connect string settings aren't proper or that the caller (ASPNET) doesn't
have permission on the (file/database).
I hope this helps
Dan R
--------------------
>Thread-Topic: Can't Open Db from Web Service
>thread-index: AcTb4Zvx6VDbehmATUiWkCHjTxQ6TA==
[quoted text clipped - 16 lines]
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:27056
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 18 lines]
>
>System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean
asyncCall)
> System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
>methodName, Object[] parameters)
[quoted text clipped - 4 lines]
>
>System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs
e)
> System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs
>e)
[quoted text clipped - 16 lines]
>
>Thanks in advance for your help
DimX - 07 Dec 2004 08:01 GMT
Hi Dan.
Here is the connection string I use. Have in mind that it is the same as in
the Web application.
<add key="oleDbConCables.ConnectionString"
value="Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data
Source=C:\Cables.mdb;Mode=Share Deny None;Extended Properties="";Jet
OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database
Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet
OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet
OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet
OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False" />
Thanks for your help
> Hi
> What connect string are you using (please hide passwords)... If this works
[quoted text clipped - 92 lines]
> >
> >Thanks in advance for your help
Dan Rogers - 07 Dec 2004 19:21 GMT
Hi,
The problem is likely to be the location of the MDB file. Try putting it
in the same directory as the web service. Remember that requests that come
in over the web are sand-boxed and do not have access to areas outside of
the web root without you taking special care to give the process
permissions.
Did you try granting read/write access to the MDB file explicitely so that
the ASP.net process can open it?
Dan
--------------------
>Thread-Topic: Can't Open Db from Web Service
>thread-index: AcTcMuVzNwArOgJUTSS9NnZ9IS1D/A==
>X-WBNR-Posting-Host: 217.78.226.4
>From: "=?Utf-8?B?RGltWA==?=" <DimX@discussions.microsoft.com>
>References: <EDB69A92-FC0C-49D3-8794-EB31289168A1@microsoft.com>
<0IIYjc$2EHA.3744@cpmsftngxa10.phx.gbl>
>Subject: RE: Can't Open Db from Web Service
>Date: Tue, 7 Dec 2004 00:01:02 -0800
[quoted text clipped - 13 lines]
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:27066
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 46 lines]
>> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>> >Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
>> .phx.gbl!TK2MSFTNGXA03.phx.gbl
>> >Xref: cpmsftngxa10.phx.gbl
[quoted text clipped - 62 lines]
>> >
>> >Thanks in advance for your help
Gabe Garza - 09 Dec 2004 01:39 GMT
Here's the syntax for the <add> element in a Web.Config file:
<add key="" value="">
In Xml, your Web.Config is not a properly formatted Xml because if you
notice your value has "" inside of the value attribute. I'd change all the
double quotes inside of of your value attribute to single quotes.
<add key="oleDbConCables.ConnectionString"
value="Provider=Microsoft.Jet.OLEDB.4.0;Password='';User ID=Admin;Data
Source=C:\Cables.mdb;Mode=Share Deny None;Extended Properties='';Jet
OLEDB:System database='';Jet OLEDB:Registry Path='';Jet OLEDB:Database
Password='';Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet
OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet
OLEDB:New Database Password='';Jet OLEDB:Create System Database=False;Jet
OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on
Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False" />
> Hi Dan.
> Here is the connection string I use. Have in mind that it is the same as in
[quoted text clipped - 44 lines]
> > >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> > >Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXS01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
> > .phx.gbl!TK2MSFTNGXA03.phx.gbl
> > >Xref: cpmsftngxa10.phx.gbl
[quoted text clipped - 59 lines]
> > >
> > >Thanks in advance for your help