Module1.bas
资源名称:20080403.rar [点击查看]
上传用户:linhua1013
上传日期:2014-12-05
资源大小:375k
文件大小:3k
源码类别:
SQL Server
开发平台:
Visual Basic
- Attribute VB_Name = "Module1"
- Public ShJquzhi As Integer
- Public ShJzancun As String
- Public ShJnianPD As Boolean
- Public ShiJian As String
- Public Nian As String
- Public Yue As String
- Public Ri As String
- Public RiShu As Integer
- Public DLyonghuM As String
- Public DLyonghuQX As String
- Public DLyonghuMM As String
- Public TianJiaKQ_PD As Boolean
- Public XiuGaiKQ_PD As Boolean
- Public ShanChuKQ_PD As Boolean
- Public TianJiaJB As Boolean
- Public XiuGaiJB_PD As Boolean
- Public ShanChuJB As Boolean
- Public ChakanGZ_PD As Boolean
- Public TianJiaGZ_PD As Boolean
- Public XiuGaiGZ_PD As Boolean
- Public ShanChuGZ_PD As Boolean
- Public GongZiChK_PD As Boolean
- Public GongZiTJ_PD As Boolean
- 'Public GongZiXG_PD As Boolean
- Public GongZiShCh_PD As Boolean
- Public MySQL As New ADODB.Connection
- Public YongHuDL As New ADODB.Recordset
- Public TJyonghu As New ADODB.Recordset
- Public XGmima As New ADODB.Recordset
- Public ChaKanJB As New ADODB.Recordset
- Public XiuGaiJB As New ADODB.Recordset
- Public ChaKanKQ As New ADODB.Recordset
- Public KQbiaoCZ As New ADODB.Recordset
- Public GZbiaoCZ As New ADODB.Recordset
- Public GongZibiaoCZ As New ADODB.Recordset
- Public DengJibiaoCZ As New ADODB.Recordset
- Public GuiZebiaoCZ As New ADODB.Recordset
- Sub LianJie()
- On Error GoTo Err
- MySQL.CursorLocation = adUseClient
- lujing = "provider= sqloledb.1;integrated security=sspi;persist security info=false;" & "initial catalog=CPMS;data source=SU-07FAEDFAF9A8"
- MySQL.Open lujing
- Load YHdenglu
- YHdenglu.Show
- Unload QiDong
- Exit Sub
- Err:
- If Err.Number = -2147467259 Then
- Open App.Path + "err.txt" For Append As #1
- Print #1, Now; " "; "错误号:"; Err.Number; Spc(3); "错误内容:"; Err.Description; Spc(4); "已知错误"
- Close #1
- Unload QiDong
- QD = MsgBox("SQL Server服务器不存在或已经关闭!是否手动启动?", 64 + 4, "提示")
- If QD = 6 Then
- Load QiDong_ShD
- QiDong_ShD.Show
- End If
- End If
- End Sub
- Function RiJS(Nian_JS As String, Yue_JS As String) As Integer
- Select Case Yue_JS
- Case "1", "3", "5", "7", "8", "10", "12"
- RiJS = 31
- Case "4", "6", "9", "11"
- RiJS = 30
- Case "2"
- If Nian_JS Mod 4 = 0 Then
- RiJS = 29
- Else
- RiJS = 28
- End If
- End Select
- End Function
- Sub RiQiFuZhi(RiQi As String)
- For ShJquzhi = 1 To Len(RiQi) + 1
- ShJzancun = Mid(RiQi, ShJquzhi, 1)
- If ShJzancun = "-" Then
- If ShJnianPD Then
- Yue = ShiJian
- ShiJian = ""
- ShJnianPD = False
- Else
- Nian = ShiJian
- ShiJian = ""
- ShJnianPD = True
- End If
- ElseIf ShJzancun = "" Then
- RiShu = RiJS(Nian, Yue)
- ' texRi_KQ.Clear
- ' For Ri_KQ = 1 To RiShu_KQ
- ' texRi_KQ.AddItem Ri_KQ
- ' Next Ri_KQ
- Ri = ShiJian
- ShiJian = ""
- Else
- ShiJian = ShiJian & ShJzancun
- End If
- Next ShJquzhi
- End Sub