请问老师,怎么用text控件组读写取数据库的列啊
我的代码可以读取一行,但不能读取列,读取列的时候将列读到一个文本框内了,写入的代码完全失败,请老师看看我的代码教教我啊。
简历代码.zip
(18.69 KB)
Private Sub Command1_Click()
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim ii As Integer
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=888888;Data Source=" + App.Path + "\简历.mdb;Persist Security Info=False"
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "select * from 简历表 where 编号 = '" & 编号.Text & "'And 姓名='" & 姓名.Text & "'", conn, 1, 1
Do Until rs.EOF
For i = 1 To 4
Text1(i).Text = Text1(i).Text & rs(i) & vbCrLf
Next
rs.MoveNext
Loop
rs.Close
End Sub