机房收费系统之修改
2015-08-05 20:00
351 查看
**最基本的对数据库进行的修改操作,给大家来个最简单的,看图: 就拿“修改基本数据”来说: ![这就是我机房的修改基本数据窗体](https://img-blog.csdn.net/20150805195314095) 下边是代码:
Option Explicit Const xStr As String = "0123456789" Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then cmdok_Click End Sub Private Sub form_load() '将basicdata中的数据显示到该界面上 Txtsql = "select * from basicdata_info" Set mrc = ExecuteSQl(Txtsql, msgTxt) Text1.Text = mrc.Fields(0) Text2.Text = mrc.Fields(1) Text3.Text = mrc.Fields(2) Text4.Text = mrc.Fields(3) Text5.Text = mrc.Fields(4) Text6.Text = mrc.Fields(5) Me.KeyPreview = True End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) '只能输入数字 KeyAscii = IIf(InStr(xStr & Chr(8), Chr(KeyAscii)), KeyAscii, 0) End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) '只能输入数字 KeyAscii = IIf(InStr(xStr & Chr(8), Chr(KeyAscii)), KeyAscii, 0) End Sub ' 'Private Sub Text3_KeyPress(KeyAscii As Integer) ''只能输入数字 ' KeyAscii = IIf(InStr(xStr & Chr(8), Chr(KeyAscii)), KeyAscii, 0) 'End Sub Private Sub Text4_KeyPress(KeyAscii As Integer) '只能输入数字 KeyAscii = IIf(InStr(xStr & Chr(8), Chr(KeyAscii)), KeyAscii, 0) End Sub Private Sub Text5_KeyPress(KeyAscii As Integer) '只能输入数字 KeyAscii = IIf(InStr(xStr & Chr(8), Chr(KeyAscii)), KeyAscii, 0) End Sub Private Sub Text6_KeyPress(KeyAscii As Integer) '只能输入数字 KeyAscii = IIf(InStr(xStr & Chr(8), Chr(KeyAscii)), KeyAscii, 0) End Sub Private Sub command3_Click() Unload Me End Sub Private Sub cmdok_Click() Text1.Enabled = False Text2.Enabled = False Text3.Enabled = False Text4.Enabled = False Text5.Enabled = False Text6.Enabled = False '将该界面上设定的信息赋值给basicdata表中 Txtsql = "select * from basicdata_info" Set mrc = ExecuteSQl(Txtsql, msgTxt) mrc.Fields(0) = Trim(Text1.Text) mrc.Fields(1) = Trim(Text2.Text) mrc.Fields(2) = Trim(Text3.Text) mrc.Fields(3) = Trim(Text4.Text) mrc.Fields(4) = Trim(Text5.Text) mrc.Fields(5) = Trim(Text6.Text) mrc.Fields(6) = UserName mrc.Fields(7) = Date mrc.Fields(8) = Time mrc.Update mrc.Close MsgBox "基本数据设定成功!", vbOKOnly + vbExclamation, "提示" End Sub Private Sub cmdchange_Click() Text1.Enabled = True Text2.Enabled = True Text4.Enabled = True Text5.Enabled = True Text6.Enabled = True End Sub
以上代码就是我的机房收费系统的修改基本数据的全部代码,嘿嘿!**
相关文章推荐
- Android之获取手机上的图片和视频缩略图thumbnails
- 数据库链接字符串查询网站
- DB2实例管理
- DB2实例管理
- 保障MySQL数据安全的14个最佳方法
- mysql问答汇集
- 创建一个空的IBM DB2 ECO数据库的方法
- Access 2000 数据库 80 万记录通用快速分页类
- 开通一个数据库失败的原因的和解决办法
- 一个简单的asp数据库操作类
- CentOS下DB2数据库安装过程详解
- EasyASP v1.5发布(包含数据库操作类,原clsDbCtrl.asp)第1/2页
- sql2008 还原数据库解决方案
- Oracle 数据库自动存储管理-安装配置
- Oracle 数据库 临时数据的处理方法
- 数据库分页查询语句数据库查询
- 最近比较流行的数据库挂马
- 分割超大Redis数据库例子
- 重装主控服务器后,数据库连接失败的解决办法:请正确还原数据库。