请问用vb的text datagrid 通过adodc改在access中的某条记录的某个数据
我做了一个界面。。。添加了修改text1datagrid1adodc1还有个显示全部的按钮具体代码如下:PrivateSubCommand2_Click()UnloadM...
我做了一个界面。。。添加了修改 text1 datagrid1 adodc1 还有个显示全部的按钮
具体代码如下:Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Adodc1.RecordSource = "select * from 产品数据"
Adodc1.Refresh
End Sub
Private Sub DG_Click()
On Error GoTo fix2:
Set Rs = Adodc1.Recordset.Fields
txtmingcheng = Rs("产品名称")
txtpay = Rs("起拍价")
txtshangjia = Rs("商家名称")
txtyunfei = Rs("运费")
txtzhifu = Rs("支付手段")
txtsonghuo = Rs("送货")
txtdianhua = Rs("联系电话")
txtjiepai = Rs("结拍时间")
fix2:
End Sub
Private Sub Form_Load()
On Error GoTo fix1:
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db\产品数据.mdb;Jet OleDb:DataBase Password=1234"
Adodc1.CommandType = adCmdText
.RecordSource = "select * from 产品数据"
Set DG.DataSource = Adodc1
.Refresh
End With
DG_Click
fix1:
Adodc1.Visible = False
End Sub 展开
具体代码如下:Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Adodc1.RecordSource = "select * from 产品数据"
Adodc1.Refresh
End Sub
Private Sub DG_Click()
On Error GoTo fix2:
Set Rs = Adodc1.Recordset.Fields
txtmingcheng = Rs("产品名称")
txtpay = Rs("起拍价")
txtshangjia = Rs("商家名称")
txtyunfei = Rs("运费")
txtzhifu = Rs("支付手段")
txtsonghuo = Rs("送货")
txtdianhua = Rs("联系电话")
txtjiepai = Rs("结拍时间")
fix2:
End Sub
Private Sub Form_Load()
On Error GoTo fix1:
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db\产品数据.mdb;Jet OleDb:DataBase Password=1234"
Adodc1.CommandType = adCmdText
.RecordSource = "select * from 产品数据"
Set DG.DataSource = Adodc1
.Refresh
End With
DG_Click
fix1:
Adodc1.Visible = False
End Sub 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询