Dim rs_login As New ADODB. You
Sub Data ()
On Error GoTo Err
Dbpath=App. Path & amp; "\ book MDB
"The ConnectionString="provider=Microsoft. Jet. The oledb. 4.0. Data source="& amp; Dbpath
Conn. Open the ConnectionString
Err:
If Err. Number Then
MsgBox "database error
"End
End the If
End Sub
Private Sub Form_Load ()
The Call Data
Dim rs_leibie As New ADODB. You
Dim As SQL String
SQL="select * from books category"
Rs_leibie. The Open SQL, Conn, adOpenKeyset, adLockPessimistic
Rs_leibie. MoveFirst
The Do While Not rs_leibie. EOF
Combo1. AddItem rs_leibie. Fields (0)
Rs_leibie. MoveNext
Loop
Rs_leibie. Close
End Sub
CodePudding user response:
Combo1. AddItem "" & amp; Rs_leibie. Fields (0)CodePudding user response:
The Do While Not rs_leibie. EOF
If not isnull (rs_leibie Fields (0)) then
Combo1. AddItem rs_leibie. Fields (0)
End the if
Rs_leibie. MoveNext
Loop
CodePudding user response:
Combo1. AddItem rs_leibie. Fields (0) & amp; ""