怎么就是不行!
这是我对数据库的条件查询,但是没有显示查询条件的结果!不知道那出了问题!
Private Sub Form_Load()
Dim db As Database
Dim rec As Recordset
Set db = OpenDatabase("D:\Documents and Settings\Administrator\My Documents\城市的评价要素+权数(德尔非法).mdb")
Set rec = db.OpenRecordset("城市的评价要素")
rec.Index = "表的索引"
rec.Seek "=", Form1.Combo2.Text
If rec.NoMatch Then
Exit Sub
End If
grd1.Rows = 2
grd1.FontSize = 12
grd1.Cols = rec.Fields.Count
For i = 0 To rec.Fields.Count - 1
grd1.ColWidth(i) = grd1.Width / rec.Fields.Count
Next i
grd1.Row = 0
For i = 0 To rec.Fields.Count - 1
grd1.Col = i
grd1.Text = rec.Fields(i).Name
Next i
For j = 0 To rec.Fields.Count - 1
grd1.Col = j
grd1.Text = rec(j)
Next j
End Sub