M
Mel
Can anyone assist me in how I would structure this code to update
every record in a table? I need to loop through each record and
increase the cost field by a certain percentage. How do I loop
through *and* update each record? Here is my code so far:
'Start of Example Code
Dim strConStand As String = "Provider=Microsoft.JET.OLEDB.4.0;Data
Source =c:\w\standards.mdb"
Dim strFreight As String = "Select [Cost] FROM [Freight];"
Dim recFreight As System.Data.OleDb.OleDbDataReader
Dim conFreight As New
System.Data.OleDb.OleDbConnection(strConStand)
Dim comFreight As New System.Data.OleDb.OleDbCommand(strFreight,
conFreight)
conFreight.Open()
recFreight = comFreight.ExecuteReader
Do While recFreight.Read
'increase every cost by 5%
Loop
recFreight.Close()
conFreight.Close()
'End of Example Code
every record in a table? I need to loop through each record and
increase the cost field by a certain percentage. How do I loop
through *and* update each record? Here is my code so far:
'Start of Example Code
Dim strConStand As String = "Provider=Microsoft.JET.OLEDB.4.0;Data
Source =c:\w\standards.mdb"
Dim strFreight As String = "Select [Cost] FROM [Freight];"
Dim recFreight As System.Data.OleDb.OleDbDataReader
Dim conFreight As New
System.Data.OleDb.OleDbConnection(strConStand)
Dim comFreight As New System.Data.OleDb.OleDbCommand(strFreight,
conFreight)
conFreight.Open()
recFreight = comFreight.ExecuteReader
Do While recFreight.Read
'increase every cost by 5%
Loop
recFreight.Close()
conFreight.Close()
'End of Example Code