数据库出问题,高手帮忙!

Dim db1 As Database Dim db As ADODB.Connection Dim rs As Recordset Dim sqlstr As String Private Sub Command1_Click() systemname = systemnm.Text systempassword = systempd.Text systemmoney = systemmoney1.Text responsetimes = responsetime.Text If systemname <> "" And systempassword <> "" And systemmoney <> "" Then If (rs.RecordCount = -1) Then rs.AddNew rs.Fields("系统名称") = systemname rs.Fields("系统密码") = systempassword rs.Fields("初始金额") = systemmoney rs.Fields("响应时间") = responsetimes rs.Update Else rs.Delete rs.AddNew rs.Fields("系统名称") = systemname rs.Fields("系统密码") = systempassword rs.Fields("初始金额") = systemmoney rs.Fields("响应时间") = responsetimes rs.Update MsgBox ("系统初始设置成功!") End If Else MsgBox ("请填写好完整信息") End If End Sub Private Sub Text3_Change() End Sub Private Sub Command3_Click() Unload Me End Sub Private Sub Form_Load() Set db = New ADODB.Connection db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path & "/Database/Car.mdb" + ";Persist Security Info=False" Set rs = New ADODB.Recordset rs.ActiveConnection = db rs.Open ("select * from Csh") systemnm.Text = "" systempd.Text = "" systemmoney1.Text = "" responsetime.Text = "" End Sub 我是菜鸟拉,为何我的rs.addnew和rs.delete会出问题,导致对象不能完成执行程序
  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值