Code:
Private Sub Command1_Click()
Dim loadrs As ADODB.Recordset
Dim loadcn As ADODB.Connection
Dim loaddbcon As New DLLConnectionFunction
Set loaddbcon = New DLLConnectionFunction
If loaddbcon.ConnectDBMsSQLOLEDB2005(loadcn, "localhost", "inventory", "sa", "password") = True Then
Dim strsql As String
strsql = "select * from testview"
If loaddbcon.ConnectRS(loadcn, loadrs, strsql, rsadOpenStatic, rsadLockPessimistic) = True Then
loadrs.MoveFirst
Do Until loadrs.EOF
Dim str As String
str="Update tbinvent " & _
"Set Markup_Out=200, " & _
"Markup_In=200, " & _
"SellingPriceOut=(2 * loadrs.fields("listcost"))+ loadrs.fields("listcost")), " & _
"SellingPriceIn=(2 * loadrs.fields("listcost"))+ loadrs.fields("listcost")) " & _
"where itemid=loadrs.fields("itemid") "
loadrs.MoveNext
Loop
MsgBox "Done"
End If
End Sub
Basically, I just need to update the selling price.
Please help correct my code. Thank you