[Webinar] Streamline your web hosting managementRegister Today

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

Excel Add-in VB.net Problem connecting to SQL

Hi. I am getting the error trying to connect to a SQL database from my VB.net Excel add-in.
This error hasn't come up in two years and has suddenly arisen after I installed Office 2013 alongside  my existing Office 2007. The error happens at the fourth line of the following code:

            Dim cn As New SqlConnection(oConnectionString)

            Dim adp As New SqlDataAdapter(SQLExpression, cn)

            Dim ds As New DataSet

            adp.Fill(ds, "SystemData") 'Error at this line

Murray Brown
Murray Brown
  • 2
1 Solution
Valliappan ANSenior Tech ConsultantCommented:
Is the TCP/IP protocol enabled in your SQL Server?

Check this link: http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html

Hope that helps.
Valliappan ANSenior Tech ConsultantCommented:
Also check this link:


You may need to set priorities, or Named Pipes.
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks for your help

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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