There are very few examples to be found on the Internet of using an ADODB.Command with ADODB.Parameters objects to issue a SQL INSERT statement to an Access table. Here is a working example! 
 
	
	
	
		
I found lists of Parameters Types here:
 
"ADO » Command » CreateParameter"
http://www.devguru.com/technologies/ado/8528.asp
 
"ADO CreateParameter Method"
http://www.w3schools.com/ado/met_comm_createparameter.asp
 
And I finally found the list of Type Sizes here:
 
"Data Type Mapping"
http://www.carlprothman.net/Default.aspx?tabid=97
 
The example which finally worked, just was a bit more elaborate than I needed was found here:
 
"Problems using a SQL INSERT command with ADODB"
http://www.tek-tips.com/viewthread.cfm?qid=1042219
Posting by: "fredericofonseca (IS/IT--Management) 25 Apr 05 12:27"
Update Note: I have updated this post to use Late-Binding syntax to create the ADO object(s). You will also need to use this post to obtain all of the constants ADO utilizes in order to have complete success with Late-Binding.
ADO Constants for use with Late Binding ActiveX Data Objects 2.8 Library
http://www.access-programmers.co.uk/forums/showthread.php?t=243088
 
		Code:
	
	
	Public Function Insert() As Boolean
On Error GoTo Err_Insert
  Dim adoCMD As Object
  Dim adoRS As Object
  Dim strSQL As String
  'Define a query to INSERT a new record into the FE temp table
  strSQL = "INSERT INTO [" & Me.FETempTableName & "] ([partnumber],[title],[qtyper],[oldqtyper],[addpartrecordflg],[doneflg])" & vbCrLf & _
           "VALUES (p1,p2,p3,p4,p5,p6);"
  'Define attachment to database table specifics
  Set adoCMD = CreateObject("ADODB.Command")
  With adoCMD
    .ActiveConnection = CurrentProject.Connection
    .CommandType = adCmdText
    .Parameters.Append .CreateParameter("p1", adVarChar, adParamInput, 25, Me.partnumber)
    .Parameters.Append .CreateParameter("p2", adVarChar, adParamInput, 50, Me.title)
    .Parameters.Append .CreateParameter("p3", adSmallInt, adParamInput, 2, Me.qtyper)
    .Parameters.Append .CreateParameter("p4", adSmallInt, adParamInput, 2, Me.oldqtyper)
    .Parameters.Append .CreateParameter("p5", adBoolean, adParamInput, 2, True)
    .Parameters.Append .CreateParameter("p6", adBoolean, adParamInput, 2, False)
    .CommandText = strSQL
    Set adoRS = .Execute
  End With
  'Return a good return code
  Insert = True
Exit_Insert:
  'Clean up the connection to the database
  Set adoRS = Nothing
  Set adoCMD = Nothing
  Exit Function
Err_Insert:
  Call errorhandler_MsgBox("Class: " & TypeName(Me) & ", Function: Insert()")
  Insert = False
  Resume Exit_Insert
End Function
	"ADO » Command » CreateParameter"
http://www.devguru.com/technologies/ado/8528.asp
"ADO CreateParameter Method"
http://www.w3schools.com/ado/met_comm_createparameter.asp
And I finally found the list of Type Sizes here:
"Data Type Mapping"
http://www.carlprothman.net/Default.aspx?tabid=97
The example which finally worked, just was a bit more elaborate than I needed was found here:
"Problems using a SQL INSERT command with ADODB"
http://www.tek-tips.com/viewthread.cfm?qid=1042219
Posting by: "fredericofonseca (IS/IT--Management) 25 Apr 05 12:27"
Update Note: I have updated this post to use Late-Binding syntax to create the ADO object(s). You will also need to use this post to obtain all of the constants ADO utilizes in order to have complete success with Late-Binding.
ADO Constants for use with Late Binding ActiveX Data Objects 2.8 Library
http://www.access-programmers.co.uk/forums/showthread.php?t=243088
			
				Last edited: