PDA

View Full Version : Connection to SQL Server Database using generated Data Source fails ...



vodkasoda
02-18-2017, 11:38 AM
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 ...

18421

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

18422

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

18423

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

18424

... 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 ...

18421

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

Thanks ...

vodkasoda
02-19-2017, 05:23 AM
This can be closed, I have found the answer elsewhere ...