Unable to connect to SQL Server 2014 via sConnString

Trying to connect to a SQL Server 2014 and receive the error : (System.Data.OleDb.OleDbException: '[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.')

I'm not sure what is wrong with the code below.

This is my code:

' Set connection to the database Dim oOleDbConnection As OleDbConnection = Nothing 'Create db connection Dim objCmd As OleDbCommand = Nothing Dim sConnString As String, strSQL As String, strSQLSelect As String

    'Connection string for database
    sConnString = "Provider=SQLOLEDB;Server=RICKNDELLM2800\SQLEXPRESS;Database=ExactMAXSAM;User ID=sa;Password=M@x@dm1n;"
    oOleDbConnection = New OleDbConnection(sConnString)
    oOleDbConnection.ConnectionString = sConnString
    oOleDbConnection.Open()

    frmimport.Show() 'to display subform

    oOleDbConnection = New OleDb.OleDbConnection(sConnString)
    oOleDbConnection.Open()
0
edit delete
are you sure?
asked Rick Nicholson

0 answers

Post an answer but please login first

Post Answer
  1. Please login to post answer

Similar Questions

Tagsfor this question

Forumall questions