is there a way to save a table to a database faster than this. once the records start to add up this method becomes very slow
For i = 0 To sTblOrders.RowCount-1
Timex=sTblOrders.Cell("OrderTime",i)
ProdNo=sTblOrders.Cell("ProductCode",i)
ProdPrice=sTblOrders.Cell("ProductPrice",i)
Qty=sTblOrders.Cell("Qty",i)
'add row to database
ItemNo =i
txt= "('" & VanNo & "','" & CustCode & "','" & TrxNo & "','" & ItemNo _
& "','" & Timex & "','" & ProdNo & "','" & ProdPrice & "','" & Qty & "')"
command.CommandText = "INSERT INTO Sales VALUES " & txt
Command.ExecuteNonQuery
Next
Still Learning
:sign0104:
For i = 0 To sTblOrders.RowCount-1
Timex=sTblOrders.Cell("OrderTime",i)
ProdNo=sTblOrders.Cell("ProductCode",i)
ProdPrice=sTblOrders.Cell("ProductPrice",i)
Qty=sTblOrders.Cell("Qty",i)
'add row to database
ItemNo =i
txt= "('" & VanNo & "','" & CustCode & "','" & TrxNo & "','" & ItemNo _
& "','" & Timex & "','" & ProdNo & "','" & ProdPrice & "','" & Qty & "')"
command.CommandText = "INSERT INTO Sales VALUES " & txt
Command.ExecuteNonQuery
Next
Still Learning
:sign0104: