Access VBA connection to SharePoint

Joined
Apr 17, 2012
Messages
1
Reaction score
0
Hi All,

So I have a problem I can't solve. I already wrote the code connecting to SharePoint via Access VBA and ADO connection. Here is a little of my connection string.

Code:
    Dim davDir As New ADODB.Record
    Dim davFile As New ADODB.Record
    Dim davFiles As New ADODB.Recordset
    Dim davCnn As New ADODB.Connection
    Dim isDir As Boolean
    Dim tempURL As String
    On Error GoTo showErr
    
    tempURL = "URL=" & URL
    
    davCnn.ConnectionString = tempURL
    davCnn.Open
    
    davDir.Open "", _
        davCnn, _
        adModeReadWrite, _
        adFailIfNotExists, _
        adDelayFetchStream

So, the first time I run my routine I am able to write a directory tree file which maps the sharepoint folders and files accurately. However, on subsequent runs of my routine the data does not appear to be current. For example, if I run my routine the first time and have a current directory tree written to a file, then if I go to the sharepoint site and remove a file, when I re-run my rountine the file still shows up written to my directory tree file. I then have to close down Access, re-open, re-run (this causes me to have to log in again), and then my directory file writes accurately with the aforementioned removed file gone.

Originally, I thought my connection was staying open, but I explicitly close it at the end of my sub routine. I also, thought perhaps this has to do with IE and because IE is automatically authenticating my log in after my initial log in, when the program is re-ran, it is pulling cached data.

I am not sure about any of these and am totally up against a wall on this one. Any helps is greatly appreciated.

PizzaDude36
6+ years Access/Excel VBA developer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top