**********************************
I'm kidding of course.
Firstly I realise this may be the incorrect forum to use, but here's the issue...
I receive a little error message (see below) when using my ASP.NET Web service from MS Access (VBA).

The call is fine, and the Web method seems to complete its little job (very trivial, just a server-side DB insert, where the DB - an MDB to be precise - is also server-side), but on the way back I receive the error.
I've scoured the Web for clues/solution but to no avail.
Here is MyTestClass.asmx:
<%@ WebService Language="vb" Class="MyTestClass" %>
Imports System
Imports System.Web.Services
Imports System.Data.OleDb
Public Class MyTestClass :Inherits WebService
<WebMethod()> Public Function AddItem ()
Dim strAboutVBConn As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=[myAbsoluteWebServerPath]/database/[MyDatabase].mdb"
Dim ocmdAboutVBCommand As OleDbCommand
Dim odtrAboutVBDataReader As OleDbDataReader
ocmdAboutVBCommand = New OleDbCommand()
With ocmdAboutVBCommand
.Connection = New OleDbConnection(strAboutVBConn)
.Connection.Open()
.CommandText = "INSERT INTO tblMyTable (FieldOne) VALUES ('test')"
.ExecuteNonQuery()
End With
End Function
End Class
In my MS Access app I have my Web service class, created for me by Web Service References Tool 2.0 and based on my Web serice.
I also have a simple method call to add an item triggered by a button on a form.
So, briefly we have:
Access (TestCall_Click)
---> Access (call AddItem on SoapClient30 object)
---> Web (process call to Web method AddItem)
---> Access (error caught by AuctionItemsErrorHandler*)
* here's the error handler method in VBA:
Private Sub AuctionItemsErrorHandler(str_Function As String) '***************************************************************** 'This subroutine is the class error handler. It can be called from any class subroutine or function 'when that subroutine or function encounters an error. Then, it will raise the error along with the 'name of the calling subroutine or function. '***************************************************************** 'SOAP Error If sc_AuctionItems.FaultCode <> "" Then Err.Raise vbObjectError, str_Function, sc_AuctionItems.FaultString 'Non SOAP Error Else Err.Raise Err.Number, str_Function, Err.Description End If End Sub
Let me know if any of these makes sense, and if you require more information.
Many thanks,
Chris

New Topic/Question
This topic is locked




MultiQuote


|