saving table data

Smee

Well-Known Member
Licensed User
Longtime User
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:
 

Smee

Well-Known Member
Licensed User
Longtime User
Thank you Erel,

However Connection.CreateSQLTable. would not work because the Table already exists and the data is an update of an existing table. Is there an append command similar to this?

Thanks

Joe
 

Smee

Well-Known Member
Licensed User
Longtime User
Thank you Erel

i will try this
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…