• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1238
  • Last Modified:

Excel Code not seeing ODBC driver for Sybase

I am using Win7 and Excel 2010 and the code below error's out.  I have check the ODBC connection and am able to see the ODBC driver with I go to the Data tab in Excel and choose Data Sources from other connections. I have spoke to my tech dept and Sybase and now I am going to see if any Experts have experienced this.  I am running a stored proc from Sybase in Excel VBA

Please see below:

 I am getting this error:  "Microsoft ODBC Driver Manager Data source name not found and no default driver specified on this line
oConnection1.Open m_sConnstr in the code below
Dim oConnection1 As ADODB.Connection
  Dim m_oRecordset1 As ADODB.Recordset

  m_sConnStr = "DSN=" + strODBCName + ";Server=" + strServerName + ";Database=ABC1;UID=ABC1APP;PWD=" + strDBPassWord
  Application.ScreenUpdating = False
  Application.Calculation = xlCalculationManual

' Create and Open the Connection object.
  Set oConnection1 = New ADODB.Connection
  oConnection1.CursorLocation = adUseClient
  oConnection1.Open m_sConnStr
1 Solution
Try this

m_sConnStr = "Provider=Sybase.ASEOLEDBProvider;" & _
           "Srvr=" & strServerName & ";" & _
           "Catalog=ABC1;" & _
           "User Id=ABC1APP;" & _
           "Password=" & strDBPassWord

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now