Author |
Topic |
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-27 : 13:22:30
|
I'm trying to connect to SQL Server Express from an application that is on the same computer as SQL Server Express. What is the syntax for establishing a SQL Server connection id?Any help would be appreciated.Thanks, |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2014-01-27 : 14:01:55
|
https://www.connectionstrings.com/sqlconnection/attach-a-database-file-on-connect-to-a-local-sql-server-express-instance/------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-27 : 15:07:47
|
Is there a simple way to test my connection ID inside SQL? It is not working in the application, so I wanted to see if I could eliminate any application issue. |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-27 : 15:26:52
|
The udl file is connecting fine, but I'm still having issues with the actual connection string in the application. |
 |
|
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-27 : 15:27:23
|
Is there a way to get the actual output from the udl? |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-01-27 : 15:29:46
|
What error are you getting? Let's start with that.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
 |
|
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-27 : 16:22:11
|
Actually, I'm still working on that, because the application is stating 'No Errors Occurred'. However I know that's not true because I purposely changed the cid to something false and it still stated 'No Errors Occurred'.This is the cid I'm attempting to use:"data source=mycomputer\SQLEXPRESS;initial catalog=Test_SerialNumber;User Id=sa;Password=barney;" |
 |
|
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-28 : 09:11:12
|
I got it up and running. The problem was the syntax on the application side. Because the application in called Wonderware InTouch, it requires its own syntax to connect to SQL Server Express, as follows:ResultCode = SQLConnect(test_Cid, "Provider=SQLOLEDB.1;User ID=sa;Password=barney;Initial Catalog=database;Data Source=mycomputer\SQLEXPRESS");ResultCode is just a way to troubleshoot errors between the application and SQL, and test_Cid is a session ID (memory integer) used to open and close the cid. |
 |
|
sfjtraps
Yak Posting Veteran
65 Posts |
Posted - 2014-01-28 : 09:11:49
|
Thank you for your help! |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|