addattachment using Access 2003
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
addattachment using Access 2003

 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development
Author Message
Rashmi
Guest





Posted: Thu Jan 20, 2005 5:01 am    Post subject: addattachment using Access 2003 Reply with quote

I am developing an Access 2003 application for my company that is using
Sharepoint as a repository for customer complaints. From within Access 2003 I
have provided a text box from which they can select a file on the users local
PC and would like to have that file uploaded to a sharepoint and a specific
list item (for testing purposes I am using the first record in that list). I
have used the Web references to create class library, however when I call the
ADDATTACHMENT method, I get an runtime error as shown below:

Run-time error '-2147024809 (80070057)':

WSDLReader:XML Parser failed as linenumber 0, lineposition 0, reason
is: The system cannot locate the object specified.
HRESULT=0x1: Incorrect Function.
- WSDLReader:Loading of the WSDL file failed
HRESULT=0x80070057: The parameter is incorrect.
- Client:One of the parameters supplied is invalid.
HRESULT=0x80070057: The parameter is incorrect.

This is a cryptic message that does not tell me much about what I did wrong.
I followed the sketchy documentation for using the Web Services Toolkit,
tried different values for the parameters, but......

The VBA code I am using is:

Public Function sppaddattachment(Optional strList As String, _
Optional strFPIRid As String, _
Optional strFileUrl As String)

Dim BaseWeb As New clsws_Lists
Dim strStatus As Variant

strFileUrl = "c:\roi\950-207-1200.xls"
strList = "\sites\imfcstrain\tblFPIRData"
strFPIRid = "1"

Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
If Not fs.FileExists(strFileUrl) Then
MsgBox strFileUrl & " is not found"
Exit Function

End If

strStatus = BaseWeb.wsm_AddAttachment(strList, _
strFPIRid, strFileUrl, FileToByte(strFileUrl))

End Function

Public Function FileToByte(fname As String) As Byte()
Dim fnum As Integer
fnum = FreeFile
On Error GoTo FileErr
Open fname For Binary Access Read As fnum
On Error GoTo 0
Dim byt() As Byte
ReDim byt(LOF(fnum) - 1)
byt = InputB(LOF(fnum), fnum)
Close fnum
FileToByte = byt
Exit Function
FileErr:
MsgBox "File error: " & Err.Description
End Function

Can you please help and shed some light as to what I am doing wrong. I am
desperate as I have been struggling with this for the past few weeks.

Thanks...
Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Portal Server Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB