ok. i haven't used ado, i've used dao...so i'll give the code based on that.
Sub Macro1()
Dim acsObj As Object
Dim acsTbl As DAO.Recordset
Dim acsDb As String
acsDb = "C:\db1.mdb"
Set acsObj = CreateObject("Access.Application")
acsObj.Visible = False
acsObj.OpenCurrentDatabase acsDb
Set acsTbl = CurrentDb.OpenRecordset("Table1", dbOpenDynaset, dbAppendOnly)
For irow = 2 To 5
With acsTbl
.AddNew
.Fields("First Name").Value = Worksheets("Sheet1").Cells(irow, 1)
.Fields("Last Name").Value = Worksheets("Sheet1").Cells(irow, 2)
.Fields("DOB").Value = Worksheets("Sheet1").Cells(irow, 4)
.Fields("Income").Value = Worksheets("Sheet1").Cells(irow, 6)
.Update
End With
Next
acsTbl.Close
Set acsTbl = Nothing
acsObj.CloseCurrentDatabase
acsObj.Quit
Set acsObj = Nothing
End Sub
note that in the line "acsObj.visible = false", the "false" can be changed to "true" if you want to see access working in front of you. also, remove the lines "acsTbl.Close" and "acsObj.CloseCurrentDatabase" and "acsObj.Quit" if you want to leave the access database open once the appending is done.
code for ADO should be similar, with few syntax changes for the recordset object. other than that, it should be the same.
oh, important! in the
vb code window, under tools, and references, you need to check "Microsoft Access Objects" (or something like that), and for the code i just wrote, you also need to check "Microsoft DAO objects"...if you adapt it to ADO, then that's the one you'll need to check.
hope this helps!