我想要的是最简单的例子..比如.建了一个MDB文件(ACCESS数据库)了..文件里就只有两个字段..一个是编号..一个是卡号..我用两个TEXT框...来显示这两个字段........然后...四个按键"首条","下一条","上一条"."尾条"用这四个按键.就能让数据库里的数据.显示在两个TEXT文本框里..可能这题目太入门了..还是请有空的大侠们.赐教一下...万分感谢~~

解决方案 »

  1.   


    Private Sub Command2_Click()
        Adodc1.Recordset.MoveNext
    End SubPrivate Sub Command3_Click()
      Adodc1.Recordset.MovePrevious
    End Sub
    Private Sub Command4_Click()
       Adodc1.Recordset.MoveLast
    End SubPrivate Sub Form_Load()
      Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb;Persist Security Info=False"
      Adodc1.CommandType = adCmdText
      Adodc1.RecordSource = "select * from 表1"
      Adodc1.Refresh
      Set Text1.DataSource = Adodc1
      Text1.DataField = Adodc1.Recordset.Fields(0).Name
      Set Text2.DataSource = Adodc1
      Text2.DataField = Adodc1.Recordset.Fields(1).Name
      
    End Sub
      

  2.   


    Private Sub Command1_Click()
      Adodc1.Recordset.MoveFirst
    End Sub
    Private Sub Command2_Click()
        Adodc1.Recordset.MoveNext
    End SubPrivate Sub Command3_Click()
      Adodc1.Recordset.MovePrevious
    End Sub
    Private Sub Command4_Click()
       Adodc1.Recordset.MoveLast
    End SubPrivate Sub Form_Load()
      Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb;Persist Security Info=False"
      Adodc1.CommandType = adCmdText
      Adodc1.RecordSource = "select * from 表1"
      Adodc1.Refresh
      Set Text1.DataSource = Adodc1
      Text1.DataField = Adodc1.Recordset.Fields(0).Name
      Set Text2.DataSource = Adodc1
      Text2.DataField = Adodc1.Recordset.Fields(1).Name
      
    End Sub