标题:[求助]怎样把数据更新到access中
取消只看楼主
cxq5188
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-5-27
 问题点数:0 回复次数:0 
[求助]怎样把数据更新到access中
编译可以通过但就是不行 截取关键代码如下 ;大家帮帮看看
Case "保存"
If conn.State = ConnectionState.Closed Then
conn.Open()
End If
'dzbh = ds.Tables("读者信息表").Rows(DataGrid1.CurrentRowIndex).Item(0)
Dim str As String
str = "update xinxi set 姓名 = '" & TextBox4.Text & "',所属部门 = '" & ComboBox1.SelectedItem & "',民族 = '" & TextBox5.Text & "',年龄 = '" & TextBox6.Text & "',性别 = '" & TextBox7.Text & "',职位 = '" & TextBox8.Text & "',学历 ='" & TextBox9.Text & "' where 员工ID = '" & TextBox3.Text & "'"
comm.Connection = conn
comm.CommandType = CommandType.Text
comm.CommandText = str
da.SelectCommand = comm
da.Fill(ds, "xinxi")
If Me.ds.Tables.Count <> 0 Then
ds.Clear()
comm.Connection = conn
comm.CommandType = CommandType.Text
comm.CommandText = "select * from xinxi "
da.SelectCommand = comm
da.Fill(ds, "xinxi")
MessageBox.Show("员工信息保存成功", "提示信息")
TextBox3.Enabled = False
TextBox4.Enabled = False
TextBox5.Enabled = False
ComboBox1.Enabled = False
TextBox6.Enabled = False
TextBox7.Enabled = False
TextBox8.Enabled = False
TextBox9.Enabled = False
Me.DataGrid1_Click(Nothing, Nothing)
ToolBarButton8.Enabled = False
End If
搜索更多相关主题的帖子: access 数据 str 
2006-05-29 02:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-68103-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.280975 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved