Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Problem while creating a DSN

Author  Topic 

Venu@wfis
Starting Member

16 Posts

Posted - 2009-03-18 : 11:01:24
I have SQL Server 2000 on a remote machine. I am able to do a RDP (Remote Access as Run> mstsc) and connect to the machine either by providing the IP: 10.2.1.41 or 't01sql01.dsm.tic.wellsfargo.com'.
But when I try to create a DSN with these crendentials I am getting the following error.

"Runtime Error '-2147467259(800004005)
Automation Error
Unspecified Error"

The same is the problem even if try creating through a VBA code or through menu options in Eccel. Can you please help. Below is the code that i have used:

Sub Extract_data_frm_sql()

Dim cnt As ADODB.Connection
Dim rst As ADODB.Recordset
Dim stSQL As String
Dim wbBook As Workbook
Dim wsSheet As Worksheet
Dim rnStart As Range

Const stADO As String = ("Provider=SQLOLEDB;Server=10.2.1.41, 445;Database=migration_mtg_bau_db;User name=dsmtic\vpatlol;Password=Venu@0681;")

Set wbBook = ActiveWorkbook
Set wsSheet = wbBook.Worksheets(1)

With wsSheet
Set rnStart = .Range("A1")
End With

stSQL = "select ts_User_07 as [Project No] from td.Test"
Set cnt = New ADODB.Connection
With cnt
.CursorLocation = adUseClient
.Open stADO
.CommandTimeout = 0
Set rst = .Execute(stSQL)
End With
rnStart.CopyFromRecordset rst

rst.Close
cnt.Close
Set rst = Nothing
Set cnt = Nothing

End Sub

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-03-20 : 10:34:03
I hope these aren't real passwords etc
Go to Top of Page

gvphubli
Yak Posting Veteran

54 Posts

Posted - 2009-03-20 : 19:54:47
Looking at the error, I feel the drivers(the client components) are not installed or not installed correctly on the system. Please try re-installing the client components.


TechnologyYogi
http://gvphubli.blogspot.com/
Go to Top of Page
   

- Advertisement -