我用VB报表生成器遍了一个打印程序,怎么老提示找不到Text,请高手指点一下,原代码如下:
Private Sub DataReport_Initialize()
Dim cnn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String
Dim strsql As String
str = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\databases\try.mdb;" & _
"Mode=Read|Write|Share Deny None;" & _
"Persist Security Info=False"
cnn.Open str
rs.CursorLocation = adUseClient
strsql = "select * from 管串数据报表"
rs.Open strsql, cnn, adOpenDynamic, adLockOptimistic
Set DataReport1.DataSource = rs
DataReport1.Sections(1).Controls("Text1").DataField = rs.Fields(1)
DataReport1.Sections(1).Controls("Text2").DataField = rs.Fields(2)
DataReport1.Sections(1).Controls("Text3").DataField = rs.Fields(3)
End sub