Insert all the rows without errors into a database called pipeline.mdb
Posted on 2005-03-05
Hi Everyone I did a loop that checks the records from Excel for errors. The records with errors go into an errors spreadsheet which I already did, but all the records without error need to be inserted into my database (pipeline.mdb)
Can you guys help me with this? Basically the entire row gets inserted into the database...I have an if statment that looks for the rows to be inserted but I don't know what code I can use to actually insert them...
Here's my code but of course it doesn't work.
for i = 1 to 14
if (errors in the records)then 'pseudocode
'put records into the excel spreadsheet --this part works, no problem
'Database records without errors should be inserted into the database, I don't know how to do this?!?
Dim RS As recordset
Set CMD.ActiveConnection = Conn
CMD.CommandText = "INSERT * INTO COMPANY"
CMD.CommandType = adCmdText