工作日志VBA代码程序

时间:2023-03-21 14:17:14 阅读: 最新文章 文档下载
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Option Explicit

Dim myAccess As Object

'回调函数

Sub macro(control As IRibbonControl)

Select Case control.ID

Case "Insert"

Call Insert

Case "Serch"

Call search

End Select

End Sub

Public Sub Insert()

人力资源工作日志.Show

End Sub

Public Sub search()

人力资源日志.Show

End Sub

----------------------------------

Option Explicit

Private Data As New 数据库

Property Get Excel数据库()

Excel数据库 = "provider=microsoft.ace.oledb.12.0;extended properties=excel 12.0;data source=" & ThisWorkbook.Path & "\" & ThisWorkbook.Name

End Property

Property Get Access数据库()

' Access数据库 = "provider=microsoft.ace.oledb.12.0;data source=" & Data.Mypath & "人力资源工作日志.accdb;Jet OLEDB:Database Password=" & "245437"

Access数据库 = "provider=microsoft.ace.oledb.12.0;data source=" & Data.Mypath & "人力资源工作日志.accdb"

'-----------------------------------------------------------------

'*.accdb: ConnectionString = "Provider=Microsoft.ACE.OLEDB.15.0;" & _

"Data Source=G:\DataBase\1.accdb;" & _

"Persist Security Info=False;" & _

"Jet OLEDB:Database Password=wf"

'*.mdb: ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _

"Data Source=G:\DataBase\1.mdb;" & _

"Persist Security Info=False;" & _

"Jet OLEDB:Database Password=wf"

'----------------------------------------------------------------------

'ConnectionString = "Provider=Microsoft.ACE.OLEDB.15.0;" & _

' "data source=" & Data.Mypath & "人力资源工作日志.accdb;" & _

' "Persist Security Info=False;" & _

' "Jet OLEDB:Database Password=245437"

End Property

Property Get Mypath()

Mypath = "J:\程序编写\工作日志程序\"

' Mypath = "\\sldc-file\人力资源部\"

' 'mypath="\\172.17.1.6\人力资源部\"

End Property

'-------------------------测试导入不同数据库------------------------------

'Property Get Mypath()

' If 数据库路径 = 共享文件夹 Then

' Mypath = "\\sldc-file\人力资源部\" 'Mypath="\\172.29.1.6\人力资源部"

' ElseIf 数据库路径 = 优盘 Then

' Mypath = "K:\工作日志"

' End If

'End Property

'-------------------------测试导入不同数据库------------------------------

本文来源:https://www.wddqw.com/doc/067b694d541252d380eb6294dd88d0d233d43ceb.html