Consulting

Results 1 to 2 of 2

Thread: Connection to SQL Server Database using generated Data Source fails ...

  1. #1
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location

    Connection to SQL Server Database using generated Data Source fails ...

    I have created a small Database using Visual Studio Community 2015 & SQL Server 2014 Management Studio, it seems fine, I can import to it, edit it, run queries on it, it just seems perfectly OK.

    However, I can't connect to it from my Outlook VBA project, I get an error as follows ...

    ScreenHunter_06 Feb. 18 18.18.png

    ... This is from the Visual Studio Server Explorer ..

    ScreenHunter_06 Feb. 18 18.26.jpg

    ... These are the details of the Connection ...

    ScreenHunter_06 Feb. 18 17.53.jpg

    ... and these are the Advanced Properties ...

    ScreenHunter_06 Feb. 18 17.55.jpg

    ... The full Connection String is as follows ...

    Data Source=GARY-PC\SQLEXPRESS;Initial Catalog=KA_DataBase;Integrated Security=True

    ... But I have tried all of the following Connections (and others) in my VBA program ...

    Set KA_DB = New ADODB.Connection
    Set KA_RS_Attachments = New ADODB.Recordset
    Set KA_RS_Teams = New ADODB.Recordset
    Set KA_Com = New ADODB.Command
    
    
    'KA_DB.ConnectionString = "driver={SQL Server};" & "Data Source=GARY-PC\SQLEXPRESS;Initial Catalog=KA_DataBase;Integrated Security=True"
    'KA_DB.ConnectionString = "driver={SQL Server native Client 11.0};Data Source=GARY-PC\SQLEXPRESS;Initial Catalog=KA_DataBase;Integrated Security=True"
    KA_DB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=GARY-PC\SQLEXPRESS;Initial Catalog=KA_DataBase;Integrated Security=True"
    
    
    KA_DB.ConnectionTimeout = 30
    
    
    KA_DB.Open
    ... But always get the following error ...

    ScreenHunter_06 Feb. 18 18.18.png

    Can somebody please help ? I don't understand the seemingly unnecessary complication & the (standard Microsoft) unhelpful Error Message !!!

    Thanks ...

  2. #2
    VBAX Regular
    Joined
    Mar 2009
    Location
    Stowmarket
    Posts
    62
    Location
    This can be closed, I have found the answer elsewhere ...

Posting Permissions

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