Dim gconnection As ADODB. Connection
Dim rscomponent As ADODB. You
Dim rsargument As ADODB. You
Dim rscomponent1 As ADODB. You
Dim rsargument1 As ADODB. You
Private Sub cmdclose_Click (Index As an Integer)
Unload Me
End Sub
Private Sub cmdselectargument_Click (Index As an Integer)
'empty txtargument text box
Txtargument. Text=""
The Set rsargument1=New ADODB. You
Rsargument1. Open the "select component.com ponent_name from argument, component, componentargument where" + _
"Argument. Argument_name=" '+ comboargument. Text + "and" + _
"Argument. Argument_ID=componentargument. Argument_ID and" + _
"Componentargument.com ponent_ID=argument.com ponent_ID" gconnection, adOpenStatic adLockOptimistic,
If rsargument1. RecordCount & gt; 0 Then
Rsargument1. MoveFirst
While Not rsargument1. EOF
Txtargument. Text=txtargument. Text + rsargument. Fields (0) + CRH (13) + CRH (10)
Rsargument1. MoveNext
Wend
The Else
MsgBox "the database error!"
End the If
Rsargument1. Close
The Set rsargument1=Nothing
End Sub
Private Sub cmdselectcomponent_Click (Index As an Integer)
'empty txtcomponent text box
Txtcomponent. Text=""
The Set rscomponent1=New ADODB. You
Rscomponent1. Open the "select argument. Argument_name from argument, component, componentargument where" + _
"Component.com ponent_name=" '+ combocomponent. Text + "and" + _
"Ponent_ID ponent_ID=componentargument.com and component.com" + _
"Componentargument. Argument_ID=argument. Argument_ID", gconnection, adOpenStatic adLockOptimistic,
If rscomponent1. RecordCount & gt; 0 Then
Rscomponent1. MoveFirst
While Not rscomponent1. EOF
Txtcomponent. Text=txtcomponent. Text + rscomponent. Fields (0) + CRH (13) + CRH (10)
Rscomponent1. MoveNext
Wend
The Else
MsgBox "the database error!"
End the If
Rscomponent1. Close
The Set rscomponent1=Nothing
End Sub
Private Sub Form_Load ()
The Set gconnection=New ADODB. Connection
Gconnection. Open "DSN=property", "sa", ""
The Set rscomponent=New ADODB. You
Rscomponent. Open the "select * from component", gconnection, adOpenStatic adLockOptimistic,
'empty combocomponent combo box
Combocomponent. Text=""
'initialize combocomponent combo box
If rscomponent. RecordCount & gt; 0 Then
Rscomponent. MoveFirst
While Not rscomponent. EOF
Combocomponent. AddItem rscomponent. Fields (1)
Rscomponent. MoveNext
Wend
The Else
MsgBox "the database error!"
End the If
The Set rsargument=New ADODB. You
Rsargument. Open the "select * from argument," gconnection, adOpenStatic adLockOptimistic,
'empty comboargument combo box
Comboargument. Text=""
'initialize comboargument combo box
If rsargument. RecordCount & gt; 0 Then
Rsargument. MoveFirst
While Not rsargument. EOF
Comboargument. AddItem rsargument. Fields (1)
Rsargument. MoveNext
Wend
The Else
MsgBox "the database error!"
End the If
End Sub
Private Sub Form_Unload (Cancel As Integer)
Rscomponent. Close
The Set rscomponent=Nothing
Rsargument. Close
The Set rsargument=Nothing
Gconnection. Close
The Set gconnection=Nothing
End Sub
Tip is code the winning red words "Private Sub Form_Load ()" make a mistake,
CodePudding user response:
Reference ADODB component?CodePudding user response:
Can get the error message and paste it out?CodePudding user response: