ÃÀÈÝÔº¹ÜÀíϵͳÂÛÎÄ ÏÂÔØ±¾ÎÄ

ͼ6-6 ÉÌÆ·¹ÜÀí½çÃæ

2.Ö÷Òª´úÂë Dim yf%

Private Sub Command3_Click() On Error Resume Next If yf <> 0 Then

MsgBox \ÏÖÔÚÕýÔÚÖ´ÐÐÆäËû²Ù×÷£¬²»ÄܽøÐвéѯ£¡\Ìáʾ\Exit Sub End If

If Combo1.Text = \

MsgBox \ÇëÑ¡ÔñÒª²éѯµÄ×ֶΣ¡\Ìáʾ\ Combo1.SetFocus Exit Sub End If

If Text2.Text = \

MsgBox \ÇëÊäÈëÒª²éѯµÄÌõ¼þ£¡\Ìáʾ\ Text2.SetFocus Exit Sub End If

If Combo1.Text = \ÉÌÆ·±àºÅ\

rst.Open \ÉÌÆ·±àºÅ='\+ \

If rst.RecordCount = 0 Then

MsgBox \ûÓÐÒª²éѯµÄ¼Ç¼£¡\Ìáʾ\ End If rst.Close

Adodc1.RecordSource = \ÉÌÆ·±àºÅ='\Trim(Text2.Text) + \ Adodc1.Refresh

ElseIf Combo1.Text = \ÉÌÆ·Ãû³Æ\

rst.Open \ÉÌÆ·Ãû³Æ='\+ \

If rst.RecordCount = 0 Then

MsgBox \ûÓÐÒª²éѯµÄ¼Ç¼£¡\Ìáʾ\ End If rst.Close

Adodc1.RecordSource = \ÉÌÆ·Ãû³Æ='\Trim(Text2.Text) + \ Adodc1.Refresh Else

MsgBox \ÇëÑ¡ÔñÒª²éѯµÄÕýÈ·×ֶΣ¡\Ìáʾ\End If End Sub

Private Sub Command4_Click()

Adodc1.RecordSource = \¼Û¸ñ\ Adodc1.Refresh End Sub

Private Sub Command5_Click()

Adodc1.RecordSource = \ÓÃ;\ Adodc1.Refresh End Sub

Private Sub Form_Load() Adodc1.ConnectionString = \Server};server=(local);database=mry\

Adodc1.RecordSource = \ Adodc1.Refresh End Sub

Private Sub Command1_Click() On Error Resume Next If yf = 1 Then 'ÐÂÔö

rst.Open \* From shangpin\Cnn, adOpenKeyset, adLockOptimistic Call Check(\ÉÌÆ·±àºÅ\ If Fh = 1 Then rst.Close Fh = 0 Exit Sub

End If

'----------------------------------------- rst.AddNew

For i = 0 To 6

rst.Fields(i) = Text1(i) Next i

rst.Fields(\Èë¿âʱ¼ä\ rst.Update

For i = 0 To 6 Text1(i) = \ Next i yf = 0 rst.Close Adodc1.Refresh

ElseIf yf = 2 Then 'ÐÞ¸Ä

rst.Open \* From shangpin where ÉÌÆ·±àºÅ='\Trim(DataGrid1.Columns(0)) + \ For i = 0 To 6

rst.Fields(i) = Text1(i) Next i

rst.Fields(\Èë¿âʱ¼ä\ rst.Update yf = 0 rst.Close

Adodc1.Refresh End If

Command1.Enabled = False Command2.Enabled = False End Sub

Private Sub Command2_Click() For i = 0 To 6 Text1(i) = \ Next i yf = 0

Command1.Enabled = False Command2.Enabled = False Frame3.Enabled = False End Sub

Private Sub DataGrid1_Click()

If yf = 1 Or yf = 2 Then Exit Sub For i = 0 To 6

Text1(i) = DataGrid1.Columns(i) Next i

+

End Sub

Private Sub Toolbar1_ButtonClick(ByVal button As MSComctlLib.button) Select Case button Case \ÉÌÆ·Èë¿â\ For i = 0 To 6 Text1(i) = \ Next i

Text1(0).SetFocus

Command1.Enabled = True Command2.Enabled = True yf = 1 Case \Í˳ö\ Unload Me Case \±à¼­ÉÌÆ·\

If Text1(0) = \

MsgBox \ÇëÑ¡ÔñÒªÐ޸ĵÄÉÌÆ·\¾¯¸æ\ Else

Command1.Enabled = True Command2.Enabled = True Text1(0).SetFocus yf = 2 End If

Case \ɾ³ýÉÌÆ·\If yf <> 0 Then

MsgBox \ÏÖÔÚÕýÔÚÖ´ÐÐÆäËû²Ù×÷£¬²»ÄܽøÐÐɾ³ý£¡\Ìáʾ\Exit Sub End If

On Error Resume Next

'-------------------------------------

rst.Open \ÉÌÆ·±àºÅ='\\'------------------------------------- If Text1(0) = \

MsgBox \ÇëÑ¡ÔñҪɾ³ýµÄÉÌÆ·\¾¯¸æ\ Else

i = MsgBox(\ÊÇ·ñÈ·¶¨É¾³ýÉÌÆ·±àºÅΪ¡°\¡±µÄÉÌÆ·\vbYesNo, \Ìáʾ\

If i = vbYes Then rst.Delete Adodc1.Refresh For i = 0 To 6 Text1(i) = \ Next i Else