编一个vb程序,要求能对数据库的资料进行增删改查
2013-11-26
展开全部
用Adodc控件来作 添加该控件的步骤: project(工程)->component(部件)->Microsoft ADO Data Control 6.0(OLEDB)
代码:
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
Text1.Text = ""
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text6.Text = " "
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Update
End Sub
Private Sub Command3_Click()
datareport1.Show
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
End Sub
Private Sub Command5_Click()
Text5.Text = Val(Text3.Text) - Val(Text4.Text)
Text6.Text = Val(Text5.Text) * 0.5
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.Edit
End Sub
代码:
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
Text1.Text = ""
Text2.Text = " "
Text3.Text = " "
Text4.Text = " "
Text5.Text = " "
Text6.Text = " "
Text1.SetFocus
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Update
End Sub
Private Sub Command3_Click()
datareport1.Show
End Sub
Private Sub Command4_Click()
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
End Sub
Private Sub Command5_Click()
Text5.Text = Val(Text3.Text) - Val(Text4.Text)
Text6.Text = Val(Text5.Text) * 0.5
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.Edit
End Sub
光点科技
2023-08-15 广告
2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件...
点击进入详情页
本回答由光点科技提供
2013-11-26
展开全部
adodb 控件
Set Cn = New ADODB.Connection
Cn.ConnectionString = "路径名"
If Cn.State = adStateClosed Then Cn.Open
Set Cn = New ADODB.Connection
Cn.ConnectionString = "路径名"
If Cn.State = adStateClosed Then Cn.Open
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询