from子句错误
查询学生信息事出现from子句错误,然后有出现了对象refresh的方法iadodc失败。用VB自带的Visdata做的表,在这里面查询可以!用的是ADO控件连接。Public sqlstr As String
Public tepm As String
Private Sub num_Click()
temp = InputBox("请输入你要查询的学号")
sqlstr1 = "select 学号
sqlstr2 = "from 学生信息"
sqlstr3 = "学号=" & "'" & temp & "'"
sqlstr = sqlstr1 & sqlstr2 & sqlstr3
Form2.Show
End Sub
Private Sub Form_Activate()
Form1.Adodc1.RecordSource = sqlstr
Form1.Adodc1.Refresh
Set DataGrid1.DataSource = Form1.Adodc1
DataGrid1.Refresh
End Sub