4个回答
展开全部
我做好了,怎么发给你?
Dim conn As New ADODB.Connection
Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
Dim sqlstring As String
sqlstring = "select * from student where name='" & Combo1.Text & "'"
rs.Open sqlstring, conn, adOpenStatic, adLockOptimistic
Text1.Text = rs.Fields(1).Value
Text2.Text = rs.Fields(2).Value
Text3.Text = rs.Fields(3).Value
End Sub
Private Sub Form_Load()
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\桌面\新建文件夹 (2)\Database1.mdb;Persist Security Info=False"
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim i As Integer
sql = "select name from student"
rs1.Open sql, conn, adOpenStatic, adLockOptimistic
rs1.MoveFirst
While Not rs1.EOF
For i = 0 To rs1.Fields.Count - 1
Combo1.AddItem rs1.Fields(0).Value
Next
rs1.MoveNext
Wend
rs1.Close
End Sub
能够实现的,把程序法给你吧,因为涉及到控件和数据库
Dim conn As New ADODB.Connection
Private Sub Command1_Click()
Dim rs As New ADODB.Recordset
Dim sqlstring As String
sqlstring = "select * from student where name='" & Combo1.Text & "'"
rs.Open sqlstring, conn, adOpenStatic, adLockOptimistic
Text1.Text = rs.Fields(1).Value
Text2.Text = rs.Fields(2).Value
Text3.Text = rs.Fields(3).Value
End Sub
Private Sub Form_Load()
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Administrator\桌面\新建文件夹 (2)\Database1.mdb;Persist Security Info=False"
Dim rs1 As New ADODB.Recordset
Dim sql As String
Dim i As Integer
sql = "select name from student"
rs1.Open sql, conn, adOpenStatic, adLockOptimistic
rs1.MoveFirst
While Not rs1.EOF
For i = 0 To rs1.Fields.Count - 1
Combo1.AddItem rs1.Fields(0).Value
Next
rs1.MoveNext
Wend
rs1.Close
End Sub
能够实现的,把程序法给你吧,因为涉及到控件和数据库
展开全部
只能说一下思路,
1。绑定下拉列表,文本框和数据库的记录,可以同步显示。
2.下拉列表的变动触发事件,发送到数据库查询记录。
要做的话你也没给数据库。
1。绑定下拉列表,文本框和数据库的记录,可以同步显示。
2.下拉列表的变动触发事件,发送到数据库查询记录。
要做的话你也没给数据库。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
高手,够迅速!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这两百分来得便宜,就是错过了呀
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询