vb中combox怎么顯示數據庫數據?
二、
strSQL = "select * from dl where yhm='" & combo1.text & "' "
RS.Open strSQL, db, 3, 3
RS.Delete
RS.CLOSE
SET RS=NOTHING
一、
Dim db As New ADODB.Connection
Dim RS As New ADODB.Recordset
Private Sub Form_Load()
Combo1.Clear
db.ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & App.Path & "\db1.mdb"
db.Open
strSQL = "select * from dl Order By yhm"
RS.Open strSQL, db, 2, 2
Do While Not RS.EOF
Combo1.AddItem RS("yhm")
RS.Movenext
Loop
RS.Close
db.Close