VB的DATA控件问题
PrivateSubcmd_qry_Click()'Setdb=OpenDatabase(App.Path&"\"&"工资表.mdb")ssql=""ssql=ssql&...
Private Sub cmd_qry_Click()
'Set db = OpenDatabase(App.Path & "\" & "工资表.mdb")
ssql = ""
ssql = ssql & "select a.职工号," & vbCrLf
ssql = ssql & "select a.职工姓名," & vbCrLf
ssql = ssql & "select a.性别," & vbCrLf
ssql = ssql & "select a.职称或职务," & vbCrLf
ssql = ssql & "select a.基本工资," & vbCrLf
ssql = ssql & "select a.岗位工资," & vbCrLf
ssql = ssql & "select a.应发工资," & vbCrLf
ssql = ssql & "select a.所得税," & vbCrLf
ssql = ssql & "select a.实发工资," & vbCrLf
ssql = ssql & "select a.部门编号," & vbCrLf
ssql = ssql & "select a.参加工作时间," & vbCrLf
ssql = ssql & "select b.部门名称," & vbCrLf
ssql = ssql & "select b.部门编号" & vbCrLf
ssql = ssql & "from 基本工资表 a," & vbCrLf
ssql = ssql & " 部门表 b," & vbCrLf
ssql = ssql & "where a.部门编号=b.部门编号" & vbCrLf
If Txt_id <> "" Then
ssql = ssql & "and a.职工号='" & Trim(Txt_id) & "'" & vbCrLf
End If
Data1.RecordSource = ssql
Data1.Refresh
If Data1.Recordset.RecordCount = 0 Then
MsgBox "没有满足条件的记录存在", , "提示"
Me.MousePointer = vbDefault
cmd_conti.Enabled = False
cmd_conti.Default = False
Exit Sub
-----------------------
实时错误’3075‘:
总是提示 Data1.Refresh 语法错误 在查询表达式‘ select a.职工姓名中。
实时错误’3075‘:
操作符丢失 在查询表达式‘a.部门编号=b.部门编号 and a.职工号='001''中。
???
未解决!!! 展开
'Set db = OpenDatabase(App.Path & "\" & "工资表.mdb")
ssql = ""
ssql = ssql & "select a.职工号," & vbCrLf
ssql = ssql & "select a.职工姓名," & vbCrLf
ssql = ssql & "select a.性别," & vbCrLf
ssql = ssql & "select a.职称或职务," & vbCrLf
ssql = ssql & "select a.基本工资," & vbCrLf
ssql = ssql & "select a.岗位工资," & vbCrLf
ssql = ssql & "select a.应发工资," & vbCrLf
ssql = ssql & "select a.所得税," & vbCrLf
ssql = ssql & "select a.实发工资," & vbCrLf
ssql = ssql & "select a.部门编号," & vbCrLf
ssql = ssql & "select a.参加工作时间," & vbCrLf
ssql = ssql & "select b.部门名称," & vbCrLf
ssql = ssql & "select b.部门编号" & vbCrLf
ssql = ssql & "from 基本工资表 a," & vbCrLf
ssql = ssql & " 部门表 b," & vbCrLf
ssql = ssql & "where a.部门编号=b.部门编号" & vbCrLf
If Txt_id <> "" Then
ssql = ssql & "and a.职工号='" & Trim(Txt_id) & "'" & vbCrLf
End If
Data1.RecordSource = ssql
Data1.Refresh
If Data1.Recordset.RecordCount = 0 Then
MsgBox "没有满足条件的记录存在", , "提示"
Me.MousePointer = vbDefault
cmd_conti.Enabled = False
cmd_conti.Default = False
Exit Sub
-----------------------
实时错误’3075‘:
总是提示 Data1.Refresh 语法错误 在查询表达式‘ select a.职工姓名中。
实时错误’3075‘:
操作符丢失 在查询表达式‘a.部门编号=b.部门编号 and a.职工号='001''中。
???
未解决!!! 展开
1个回答
启帆信息
2024-11-19 广告
2024-11-19 广告
启帆信息是英伟达中国区代理商,原厂授权代理,提供全面的软件技术解决方案以及NVIDIA以太网产品、交换机等产品,欢迎前来咨询!...
点击进入详情页
本回答由启帆信息提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询