我有一个在Windows 7上运行的MS Access 2007 VBA应用程序.一个关键的功能是将文件上传到WebDAV服务器.下面的代码在一台PC上完美运行,但在其他PC上运行失败(是的,每种都以相同的方式配置).
以下是在其他PC上出现故障时弹出的Norwegion错误消息的translate.google.com转换:
Run-time error '-2147217895 (80040e19)': can not find any objects or data in accordance with the name, range or selection criteria within the scope of this operation
它在这行代码上失败了:
objRecord.Open fil, "URL=" & URL, adModeReadWrite, adCreateOverwrite, adDelayFetchStream, sUsername, sPwd
完整的功能代码如下.它实际上只是重用http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/26b8e905-33d0-438b-98a7-bb69053b931e/上的代码.任何提示将不胜感激!
Function DAVPUT(ByVal URL As String, ByVal fil As String) As Boolean '
Dim sUsername As String
Dim sPwd As String
sUsername = "k@dummy.com"
sPwd = "dummy"
Dim objRecord As New ADODB.Record
Dim objStream As …Run Code Online (Sandbox Code Playgroud)