RRinTetons
IS-IT--Management
I have a VBA function that accesses a SQL Server db via ADO to wrap a T-SQL udf that retreives a value and return it to Excel 2007. It opens a connection with the following lines:
It works fine on two machines(one XP Pro SP 2, one Vista) and fails on the line
'cnn.Open strConn'
as if the library simply weren't there on two others (both XP Pro SP 2. The function returns #VALUE.
All machines have Microsoft ADO 2.8 (msado15.dll) installed and loaded, no other ADO libraries. I have unregistered and registered that library without making any difference.
All machines can connect to the database through SSMS using the same credentials. Althugh I can't see what difference it makes since the connection never opens, bu the T-SQL the VBA wraps works when executed in SSMS.
Any other suggestions?
-
Richard Ray
Jackson Hole Mountain Resort
Code:
Set cnn = New ADODB.Connection
strConn = "Provider=SQLNCLI10.1;"
strConn = strConn + "Data Source=myServer;"
strConn = strConn + "Initial Catalog=myDatabase;"
strConn = strConn + "Integrated Security=SSPI;"
strConn = strConn + "Auto Translate=False"
cnn.Open strConn
It works fine on two machines(one XP Pro SP 2, one Vista) and fails on the line
'cnn.Open strConn'
as if the library simply weren't there on two others (both XP Pro SP 2. The function returns #VALUE.
All machines have Microsoft ADO 2.8 (msado15.dll) installed and loaded, no other ADO libraries. I have unregistered and registered that library without making any difference.
All machines can connect to the database through SSMS using the same credentials. Althugh I can't see what difference it makes since the connection never opens, bu the T-SQL the VBA wraps works when executed in SSMS.
Any other suggestions?
-
Richard Ray
Jackson Hole Mountain Resort