| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 673 人关注过本帖
标题:怎么数据库只能有一条记录
只看楼主 加入收藏
dddivan
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2007-7-8
收藏
 问题点数:0 回复次数:1 
怎么数据库只能有一条记录
录入新数据就自动把原来的记录替换调了,帮忙看看什么问题(我是新手)
comand 代码:

Private Sub Command3_Click()
If Text1.Text = "" Then
MsgBox "请输入姓名!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请输入学号!"
Exit Sub
End If
If Option1(0).Value = False And Option1(1).Value = False Then
MsgBox "请输入性别!"
Exit Sub
End If
Adodc1.Recordset("姓名") = Text1.Text
Adodc1.Recordset("学号") = Text2.Text
Adodc1.Recordset("家庭住址") = Text3.Text
MsgBox "信息录入成功!"
End Sub
搜索更多相关主题的帖子: 数据库 Sub Exit MsgBox 
2007-08-17 13:00
XieLi
Rank: 1
等 级:新手上路
威 望:1
帖 子:762
专家分:0
注 册:2007-7-24
收藏
得分:0 

Private Sub Command3_Click()
If Text1.Text = "" Then
MsgBox "请输入姓名!"
Exit Sub
End If
If Text2.Text = "" Then
MsgBox "请输入学号!"
Exit Sub
End If
If Option1(0).Value = False And Option1(1).Value = False Then
MsgBox "请输入性别!"
Exit Sub
End If
Adodc1.Recordset.AddNew
Adodc1.Recordset("姓名") = Text1.Text
Adodc1.Recordset("学号") = Text2.Text
Adodc1.Recordset("家庭住址") = Text3.Text
Adodc1.Recordset.Update
MsgBox "信息录入成功!"
End Sub



試一下吧。


拥有蓝天的白云,拥有你的我.
2007-08-17 13:29
快速回复:怎么数据库只能有一条记录
数据加载中...
 
   



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

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