Home > Software engineering >  Through the ado database is updated with the method of system error
Through the ado database is updated with the method of system error

Time:10-31

Option Explicit
Dim mycn As New ADODB. Connection
Dim myrs As New ADODB. You

Private Sub Command1_Click (Index As an Integer)
With myrs
The Select Case Index
The Case Is=0
Myrs. MoveFirst
The Case Is=1
Myrs. MovePrevious
If myrs. BOF=True Then
MsgBox "The record is first!"
Myrs. MoveFirst
End the If
The Case Is=2
Myrs. MoveNext
If myrs. EOF=True Then
MsgBox "The record is The last"
Myrs. MoveLast
End the If
The Case Is=3
Myrs. MoveLast
End the Select

Call the codebehind (categories.aspx.cs)
Label7. Caption="total" & amp; Myrs. RecordCount & amp; "Records. This is" & amp; Myrs. AbsolutePosition + 2 & amp; "Record"

End With



End Sub

Private Sub Command2_Click ()
Text1. Enabled=True
Text2. Enabled=True
Text3. Enabled=True
Text4. Enabled=True
Text5. Enabled=True
Text6. Enabled=True
Myrs. Open the "select * from room order by no", mycn, adOpenKeyset, adLockOptimistic

Call Command1_Click (0)

End Sub

Private Sub Command3_Click ()
'myrs. Open the "select * from room order by no", mycn, adOpenKeyset, adLockOptimistic

Myrs. Fields (" no ")=Text1. Text
Myrs. Fields (" style ")=Text2. Text
Myrs. Fields (" stauts ")=Text3. Text
Myrs. Fields (" price ")=Text4. Text
Myrs. Fields (" remark ")=Text5. Text
Myrs. Fields (" dep ")=Text6. Text
Myrs. Update
Myrs. Close

End Sub

Private Sub Form_Load ()
Text1. Enabled=False
Text2. Enabled=False
Text3. Enabled=False
Text4. Enabled=False
Text5. Enabled=False
Text6. Enabled=False
Text1. Text=""
Text2. Text=""
Text3. Text=""
Text4. Text=""
Text5. Text=""
Text6. Text=""

Mycn. Open "driver={SQL server}; Server=WIN - J8VPCTS806B; Uid=sa; The PWD=Cash791212 @; The database=accounting "

End Sub

Sub codebehind (categories.aspx.cs) ()
If myrs. Fields (" no ") & lt;> "" Then Text1. Text=myrs. Fields (" no")
If myrs. Fields (" style ") & lt;> "" Then Text2. Text=myrs. Fields (" style")
If myrs. Fields (" stauts ") & lt;> "" Then Text3. Text=myrs. Fields (" stauts")
If myrs. Fields (" price ") & lt;> "" Then Text4. Text=myrs. Fields (" price")
If myrs. Fields (" remark ") & lt;> "" Then Text5. Text=myrs. Fields (" remark") Else Text5. Text=""
If myrs. Fields (" dep ") & lt;> "" Then Text6. Text=myrs. Fields (" dep") Else Text6. Text=""

End Sub



When performing command3, system error
"Multi-step oledb operating errors, if possible, please check each oledb status value, no work has been completed
  • Related