VB6:对象变量或者 with 块变量未设置
Private Sub Form_Load()
Adodc3.RecordSource = "select * from ProRecord"
If Adodc3.Recordset.EOF = True Or Adodc3.Recordset.BOF = True Then 每次到这里都报错
txtProLockSum.Text = 0
txtProBlueSum.Text = 0
txtProKingSum.Text = 0
txtProGreenSum.Text = 0
txtProWhileSum.Text = 0
txtProDemoSum.Text = 0
txtReadyCardNO.Text = 1
txtReadyCardbatch.Text = 1
Exit Sub
End If
txtProLockSum.Text = Adodc3.Recordset.Fields(2)
txtProBlueSum.Text = Adodc3.Recordset.Fields(4)
txtProKingSum.Text = Adodc3.Recordset.Fields(5)
txtProGreenSum.Text = Adodc3.Recordset.Fields(6)
txtProWhileSum.Text = Adodc3.Recordset.Fields(3)
End Sub
麻烦谁帮我看看是哪里错了呀。我在数据库里的“记录源/文本命令”为空,然后在form_load()的时候:
Adodc3.RecordSource = "select * from ProRecord"
才指定记录源
[解决办法]
adodb.connection 打开库的操作没有执行吧
[解决办法]