Home > Software engineering >  For help on vb 6.0 problem for help
For help on vb 6.0 problem for help

Time:09-16

[code=vb
This is the modified code (red font is my own, and go not)
Dim photofile As String
Dim Lastx As Single, Lasty As Single

Private Sub clsphoto_Click ()
On Error GoTo err
Set the rs=New ADODB. You
Dim STRRS As String
STRRS="select * from t_group where group name='" & amp; Cmbgroupname. Text & amp; "'
"Rs. The Open STRRS, conn, adOpenKeyset, adLockBatchOptimistic
GroupID=Trim (rs) Fields (" group ID ")) 'record group ID
Rs. Close
Dim obj As String
Set the rs=New ADODB. You
Obj="select * from individual where ID=" & amp; Jilu
Rs. The Open obj, conn, adOpenKeyset, adLockOptimistic
Photo. The Picture=LoadPicture (none)
Rs. Update
'the rs. Close
Newflag=True
The Exit Sub
Err:
MsgBox "error!" , and "prompt"
End Sub

Private Sub CmdOk_Click (Index As an Integer) 'sure update contact information
Dim STRRS As String
Dim obj As String
On Error GoTo err
The Select Case Index
Case 0
Set the rs=New ADODB. You
STRRS="select * from t_group where group name='" & amp; Cmbgroupname. Text & amp; "'
"Rs. The Open STRRS, conn, adOpenKeyset, adLockBatchOptimistic
GroupID=rs. Fields (" group ID ") 'record group ID
Rs. Close
Set the rs=New ADODB. You
Obj="select * from individual where ID=" & amp; Jilu
Rs. The Open obj, conn, adOpenKeyset, adLockOptimistic
If txtname. Text="" Then" name cannot be empty
MsgBox "the name cannot be empty!" And, "wrong!"
The Exit Sub
End the If
Rs. Fields (" group ID ")=groupID
Rs. The Fields (" name ")=txtname. Text
Rs. The Fields (" id number ")=txtxuhao. Text
Rs. The Fields (" gender ")=cbosex. Text
Rs. The Fields (" class ")=txtclass. Text
Rs. The Fields (" subject ")=cbozhiwu. Text
Rs. The Fields (" phone ")=txtdianhua. Text
Rs. The Fields (" QQ number ")=TXTQQ. Text
Rs. The Fields (" email ")=txtmail. Text
Rs. The Fields (" note ")=txtfuzhu. Text
rs. Fields (" Zhou Kao scores ")=txtweekg. Text
Rs. The Fields (" monthly exam scores ")=txtmonthg. Text
Rs. The Fields (" mid-term grades ")=txtmidg. Text
Rs. The Fields (" final grade ")=txtfinalg. Text

If photo. The Picture=LoadPicture (none) Then
Rs. Fields (" photos ")=""
The Else
Rs. Fields (" photos ")=photofile
End the If
Rs. Update
Rs. Close
Newflag=True
Unload Me
The Exit Sub
Case 1
Set the rs=New ADODB. You
STRRS="select * from t_group where group name='" & amp; Cmbgroupname. Text & amp; "'
"Rs. The Open STRRS, conn, adOpenKeyset, adLockBatchOptimistic
GroupID=rs. Fields (" group ID ") 'record group ID
Rs. Close
Set the rs=New ADODB. You
Obj="select * from individual where ID=" & amp; Jilu
Rs. The Open obj, conn, adOpenKeyset, adLockOptimistic
If txtname. Text="" Then" name cannot be empty
MsgBox "the name cannot be empty!" And, "wrong!"
The Exit Sub
End the If
Rs. Fields (" group ID ")=groupID
Rs. The Fields (" name ")=txtname. Text
Rs. The Fields (" id number ")=txtxuhao. Text
Rs. The Fields (" gender ")=cbosex. Text
Rs. The Fields (" class ")=txtclass. Text
Rs. The Fields (" subject ")=cbozhiwu. Text
Rs. The Fields (" phone ")=txtdianhua. Text
Rs. The Fields (" QQ number ")=TXTQQ. Text
Rs. The Fields (" email ")=txtmail. Text
Rs. The Fields (" note ")=txtfuzhu. Text
rs. Fields (" Zhou Kao scores ")=txtweekg. Text
Rs. The Fields (" monthly exam scores ")=txtmonthg. Text
Rs. The Fields (" mid-term grades ")=txtmidg. Text
Rs. The Fields (" final grade ")=txtfinalg. Text


If photo. The Picture=LoadPicture (none) Then
Rs. Fields (" photos ")=""
The Else
Rs. Fields (" photos ")=photofile
End the If
Rs. Update
Rs. Close
MsgBox "modify success," 0 + 64, "tip"
Newflag=True
Call lianjie
Dim As SQL String
Dim As Integer I
Set the rs=New ADODB. You
SQL="select * from individual where ID=" & amp; Jilu
Rs. The Open SQL, conn, adOpenKeyset, adLockOptimistic
GroupID=Trim (rs (" group ID ")) 'record group ID
Rs. Close
Set the rs=New ADODB. You
SQL="select * from t_Group where group ID=" & amp; GroupID
Rs. The Open SQL, conn, adOpenKeyset, adLockOptimistic
If the groupID & lt;> 1 Then
Cmbgroupname. Text=Trim (rs (" group name ")) 'current members of group
End the If
Rs. Close
Set the rs=New ADODB. You
SQL="select * from t_Group"
Rs. The Open SQL, conn, adOpenKeyset, adLockOptimistic
I=1
While Not rs. EOF
Cmbgroupname. AddItem rs (" group name ")
Rs. MoveNext
I=I + 1
Wend
Rs. Close
Set the rs=New ADODB. You
Obj="select * from individual where ID=" & amp; Jilu
Rs. The Open obj, conn, adOpenKeyset, adLockOptimistic
Lbl1. Caption="in the input" & amp; Rs (" name ") & amp; "Detailed information"
Rs. Close
Set the rs=New ADODB. You
STRRS="select * from individual where ID=" & amp; Jilu
Rs. The Open STRRS, conn, adOpenKeyset, adLockOptimistic
Txtname. Text=Trim (" "& amp; Rs. Fields (" name "))
Txtxuhao. Text=Trim (" "& amp; Rs. Fields (" id number "))
Cbosex. Text=rs. Fields (" gender ")
Txtclass. Text=Trim (" "& amp; Rs. Fields (" class "))
Cbozhiwu. Text=Trim (" "& amp; Rs. Fields (" account "))
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related