+ Reply to Thread
Results 1 to 7 of 7

MS SQL Express connection string

  1. #1
    Registered User
    Join Date
    06-13-2011
    Location
    Neston, England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    38

    MS SQL Express connection string

    Hi I have an excel spreadsheet that populates a 'mysql' database and all worked fine, However I now have to use the same code to connect to a mssql express database and populate that and I just cannot figure out the connections string (I presume the rest will work OK when I get the connection string right). The mysql database was stored locally via XAMPP. And the code to connect was as follows...

    Please Login or Register  to view this content.
    I now have my database set up in MS SQL Express (Part of visual web developer 2010 express) and I just cannot get the connection string correct. I have tried so many string based on various forums I have read. The latest is below trying via oledb Does anybody know the correct way to connect from VBA (in excel)

    Please Login or Register  to view this content.
    Any help much appreciated

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: MS SQL Express connection string

    What error are you getting?

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: MS SQL Express connection string

    Shouldn't Data Source be something like '.\SQLEXPRESS'?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    06-13-2011
    Location
    Neston, England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    38

    Re: MS SQL Express connection string

    [DBNETLIB] [ConnectionOpen(Connect()).]SQL Server does not exist or access is denied

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: MS SQL Express connection string

    Are the required services, eg SQL Server Browsing, running?
    Last edited by Norie; 06-10-2013 at 12:35 PM.

  6. #6
    Registered User
    Join Date
    06-13-2011
    Location
    Neston, England
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    38

    Re: MS SQL Express connection string

    changed to

    '.\SQLEXPRESS'

    Error message is now 'login failed for user... username

    Maybe I have the password wrong now (although I am sure I dont)

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: MS SQL Express connection string

    Are you using integrated authentication (windows) or sql server authentication - username and password?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1