高手帮忙,如何将SQL表中某列赋值到空间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
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
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询