I am running the following query via VBA, to add a row to an access DB:
The weird thing is that this is a query copied directly from the SQL viewer of the query in Access itself. Where it works.
What am I doing wrong, or what do I need to do differently?
The code to connect to the DB is:
And finally this is the code to carry out the query:
strSQLinsert is defined as the query at the top of this post.
Any help would be appreciated, I've run out of things to try.
Code:
insert into ESOSdashboard (DashboardTimestamp, Proposals_Value, Proposals_No, QA_Value, QA_No, Contracted_Value, Contracted_No, Registered, Pending, Dead, OutOfScope, Contracted, Deferred, Live) values(#11/09/2014 19:54:26#, 2064653.75, 141, 1831520.25, 129, 10000, 1, 606, 563, 92, 0, 1, 1, 467)
The weird thing is that this is a query copied directly from the SQL viewer of the query in Access itself. Where it works.
What am I doing wrong, or what do I need to do differently?
The code to connect to the DB is:
Code:
strDBpath = "\\helios3\home\team.all\business generation\esos process\database\esos register2.accdb"
sConn = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & strDBpath & ";" & _
"Jet OLEDB:Engine Type=5;" & _
"Persist Security Info=False;"
' Open a connection.
Set oConn = New ADODB.Connection
errorcase = 4
oConn.Open sConn
And finally this is the code to carry out the query:
Code:
oConn.Execute (strSQLinsert)
strSQLinsert is defined as the query at the top of this post.
Any help would be appreciated, I've run out of things to try.