Dim cnn As New ADODB.Connection Dim rst As New ADODB.Recordset
Private Sub Command1_Click() Dim s As String s = "select 学号 from 学生信息表" Adodc1.RecordSource = s Adodc1.Refresh DataGrid1.ReBind End Sub
Private Sub Form_Load() cnn.Open "Provider=SQLOLEDB.1;Password=123;Persist Security Info=True;User ID=sa;Initial Catalog=jiaowu;Data Source=WIN-BM22B1HP794" End Sub