RayYeung
Joined: 27 Jun 2005
Posts: 3
|
Posted:
Wed Feb 22, 2006 2:35 am Post subject:
Error accessing public folder resource via ADO |
|
|
I have encountered a problem using ADO to access Exchange2000 public folder. The Exchange environment has only one public folder tree and no replications of the public folder tree among the servers.
Using the following code within the Exchange agent to access public folder resource produces the error:
-2147217895 Object or data matching the name, range, or selection criteria was not found within the scope of this operation.
' strURL is in the format: file://./backofficestorage/<domainname>/public folders/All public folders/target folder/
Private Function ConnectToResource(strURL)
Dim cnn
Dim rec
On Error Resume Next
Set cnn = CreateObject("ADODB.Connection")
Set rec = CreateObject("ADODB.Record")
cnn.Provider = "exoledb.datasource"
cnn.Open strURL
rec.Open strURL, cnn, adModeRead ' <<< error on this line
rec.Close
cnn.Close
On Error Goto 0
Set cnn = Nothing
Set rec = Nothing
End Function
Would anyone give me some ideas as what will be the cause of the problem.
Thanks in advance.
|
|