ADODB connection to Sharepoint, can't insert into a accdb table using GUID?

jscranton

Well-known Member
Joined
May 30, 2011
Messages
707
I am stuck on this after exhausting other resources. The code below does the following:

(a) creates an insert command for sql (strSQL)

(b) connects to a sharepoint site using an ADODB connection

(c) executes the sql command

This all worked when the accdb was stored locally. But once the table was moved to sharepoint, the execute command is erroring out ("Syntax Error in Insert INTO statement"). I am 99% sure that the issue is that I have the wrong GUID for the table. The connection opens fine but I can't locate the correct table.

According to these instructions, one refers to the table or list name by GUID. I pulled this GUID from the accdb documenter but still stuck:

Table={39885376-6EF9-4EF7-9D0B-E040FF2FCCC2D}


I really appreciate any help.

Code:
 If bytContinue = vbYes Then
    strSQL = "INSERT INTO Table(Reviewer, FeedbackDate, Project) " & _
    "VALUES (" & txtReviewer & ", " & txtFeedbackDate & ", " & txtProject & ")"
       
    Const URL = "[URL]https://thisconsultinggroup.com/lc/bd/drfi/Feedback%20Database/[/URL]"
  
    strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=0;RetrieveIDS=Yes;" & "Database=" & URL & ";Table={39885376-6EF9-4EF7-9D0B-E040FF2FCCC2D};"
    
    Set cnn = New ADODB.Connection
    cnn.Open strConnection
    
    cnn.Execute strSQL, lngSuccess
    cnn.Close
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,223,713
Messages
6,174,038
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top