我也发现在SQL_SERVER中存在类似的问题
解决方案 »
- 怎样设定MSFlexGrid的某一行的颜色?
- 高分求教,大哥大姐救命啊,我目前通过rainstormmaster(暴风雨 v2.0)online(龙卷风V2.0--再战江湖) 给的代码实现了通过SMTP发邮件的功能
- 急急急急急急!!!!,很简单的问题
- 我做了一个托盘,怎样实现我的程序不出现/出现在任务栏里(要在程序里设置)
- 放分,简单的版面问题
- 怎么检查TEXT控件中是否是数字或字符
- 我想实现多条件查询,可是总提示我表达式不匹配,不知道是什么原因,请指教!!!
- 好像想转行的哥们很多,不妨进来聊聊转行以后我们做什么?
- 急!我想用程序修改快捷方式的“目标”和“起始位置”中的地址!高手救命
- 在我看来比较棘手的问题,但我知道高手一定觉得不难!
- 如何在制作VB安装文件时加一个卸载本程序的菜单?
- 更新查询问题?急!
SQlConditonForCreate = "" _
& "SELECT " & ArrayFildsString(0) _
& " Into TempProcessedDataTable FROM ProcessedData " _
& "WHERE " & SqlConditionForProcessdata & " order by AttendDate asc"
Debug.Print SQlConditonForCreate
Dim dbs As Database
MyPath = App.Path + "\database\"
Set dbs = OpenDatabase(MyPath & "main.mdb")
dbs.Execute SQlConditonForCreate
dbs.Close
'得到考勤库语句
SentenceForProcessdata = "{" _
& "SELECT * " _
& "FROM TempProcessedDataTable " & " " _
& " } " _
& " AS Processdata" '建立人事临时数据表(EmployeeTempTable)
SentenceForEmployee = " " _
& "SELECT Employee.ID,EmployeeCode, ChineseName ,Department, Designation, ShiftGroup,HolidayGroup INTO EmployeeTempTable " _
& "FROM Employee,HolidayGroup,ShiftGroup where " & TempCountSQL
'SQlConditonForCreate = " INSERT INTO EmployeeTempTable " _
& SentenceForEmployee
Debug.Print SentenceForEmployee
Dim dbs As Database
MyPath = App.Path + "\database\"
Set dbs = OpenDatabase(MyPath & "main.mdb")
dbs.Execute SentenceForEmployee
dbs.Close
'得到人事库语句
SentenceForEmployee = "{" _
& "SELECT * " _
& "FROM EmployeeTempTable " & " " _
& " } " _
& " AS employee"
'以下是建立dataReport报表的数据源 If Connection1.State = adStateOpen Then
Connection1.Close
End If
Connection1.ConnectionString = "Provider=MSDataShape;Data Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\database\main.mdb;Persist Security Info=False"
Connection1.Open
If rsemployee.State = adStateOpen Then
rsemployee.Close
End Ifrsemployee.StayInSync = False
rsemployee.CursorLocation = adUseClient
rsemployee.LockType = adLockBatchOptimistic
rsemployee.CursorType = adOpenKeyset
Debug.Print rsemployee.State
'rsemployee.ActiveConnection = Connection1
Connection11 = " SHAPE " & SentenceForEmployee & " " _
& "APPEND (( SHAPE " _
& "{SELECT * FROM `CountForAttendance`} AS CountForAttendance " _
& "APPEND (" _
& SentenceForProcessdata & " " _
& " RELATE 'EmployeeID' TO 'EmployeeID') AS Processdata) AS CountForAttendance RELATE 'ID' TO 'EmployeeID') AS CountForAttendance " '关键的是以下代码 PauseTime = 5 ' 设置暂停时间。 ’如果不执行这一段语句,rsemployee.Open 就
报错:EmployeeTempTable不存在
Start = Timer ' 设置开始暂停的时刻。
Do While Timer < Start + PauseTime
DoEvents ' 将控制让给其他程序。
Loop
rsemployee.Open Connection11, Connection1 ’不好意思,小弟的代码太乱,敬请提出代码的书写建议