Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21197

Select Then Update Data In Access Database

$
0
0
My Database: relationship
Table: friend
column: id,name,class,total

-1,Michael,A,1
-2,Jack,B,2
-3,Samuel,C,3
-4,Bella,B,2

I have connection module,so the code just:

Code:

Dim Rsfriend As New ADODB.Recordset
Private Sub cmdhigher_Click()
  Rsfriend.LockType = adLockOptimistic
  Rsfriend.CursorType = adOpenDynamic
  Rsfriend.Open "SELECT * FROM Friend", conn, , , adCmdText
  what code to use here?
End Sub


I Want Code For:
If total = 3 then change to 4
If total = 2 then change to 3
If total = 1 then change to 2



Its Means Increase 1 in Total field,But For All Row
Database will be:
-1,Michael,A,2
-2,Jack,B,3
-3,Samuel,C,4
-4,Bella,B,3

Hope You Understand what i means,sorry if my english so bad,because i still learning english...

Viewing all articles
Browse latest Browse all 21197

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>