| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 470 人关注过本帖
标题:请教高手指点 VB+sql的问题
只看楼主 加入收藏
laoxiao
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-6-14
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
请教高手指点 VB+sql的问题
Private Sub cmdAdd_Click()
Call getcboDepId
Call getcboEmpId '获取EmpId
'检验此用户名是否已经存在
txtTest = "select * from tbWorkRecord where RecordYear ='" + Trim(Combo1.Text) + "' and "
txtTest = txtTest + "RecordMonth = '" + Trim(Combo2.Text) + "' and EmpId='" + strEmpId + "'"
If DBExist(txtTest) <> 0 Then
    MsgBox "信息已经存在,请重新输入!", vbOKOnly + vbExclamation, "警告"
Else
    txtSQL = "insert into tbWorkRecord(RecordYear,RecordMonth,EmpId,DepId,DaysPreiMonth,"
    txtSQL = txtSQL + "LeaveDays, AbsentDays, VacDays, ErrandDays,"
    txtSQL = txtSQL + "LateDays, LeaveEarlyDays, Ot1Days, Ot2Days, Ot3Days)"
    txtSQL = txtSQL + "values('" + Trim(Combo1.Text) + "','" + Trim(Combo2.Text)
    txtSQL = txtSQL + "','" + strEmpId + "','" + strDepId + "','" + Trim(quanqinday.Text)
    txtSQL = txtSQL + "','" + Trim(qingjiaday.Text) + "','" + Trim(kuanggongday.Text) + "','" + Trim(xiujiaday.Text)
    txtSQL = txtSQL + "','" + Trim(chuchaiday.Text) + "','" + Trim(chidaoday.Text) + "','" + Trim(zaotuiday.Text)
    txtSQL = txtSQL + "','" + Trim(dayday.Text) + "','" + Trim(wendday.Text) + "','" + Trim(holidayday.Text) + "')"
    result = ExecuteSQL(txtSQL, rsttbWorkRecord, True)
    MsgBox "添加成功!", vbOKOnly + vbExclamation, "警告"
    Call viewDataRecord '刷新表格中的数据
Text1.Text = Combo3.Text
End If
End Sub

为什么提示添加成 数据库里却没有数据呢
搜索更多相关主题的帖子: sql 
2010-06-14 21:50
Artless
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:103
帖 子:4211
专家分:28888
注 册:2009-4-8
收藏
得分:20 
getcboDepId
getcboEmpId
DBExist(txtTest)
这些代码?

无知
2010-06-17 23:03
快速回复:请教高手指点 VB+sql的问题
数据加载中...
 
   



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

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