Go Premium for a chance to win a PS4. Enter to Win

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • 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 ANCommented:
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 ANCommented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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