|
本帖最后由 qy0027 于 2015-10-14 15:04 编辑
在我写的一个过程中:
Function datarst(ByRef rst_s As Variant, person As Variant, perword As Variant) As ADODB.Recordset
lijie = "driver={SQL Server}; server=10.28.1.1;uid=xl;pwd=a"
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set conn = New ADODB.Connection
With conn
.ConnectionString = lijie & ";database=data"
.Open strConn
End With
Set rst = New ADODB.Recordset
With rst
.ActiveConnection = conn
.Open "select distinct code,co from user_fa where operator='" & person & "'
End With
dataword = rst.Fields(0).Value
datarole = rst.Fields(1).Value
'连接数据库操作
lijie = "driver={SQL Server}; server=10.28.1.1;uid=" & datarole & ";pwd=" & dataword
Set conn = New ADODB.Connection
With conn
.ConnectionString = lijie & ";database=data"
.CommandTimeout = 60
.Open strConn
End With
Set datarst = New ADODB.Recordset
With datarst
.ActiveConnection = conn
.Open rst_s
End With
End Function
这一个过程,这过程用vb6封装成dll文件,然后在vba中加载,在win7和xp中运行没有问题,但是在win10系统中,运行不了,报错:“错误代码429 activex部件不能创建对象”,。
不知道是什么原因,该如何解决?(操作系统:win10家庭版 64位,excel2007)
恳请各位高手指点!!!!!
|
|