Solved

Adoconnection Connection String mssql custom port

Posted on 2008-10-24
8
1,601 Views
Last Modified: 2013-11-23
Hi experts,
I am having trouble finding a good connection string to use for custom mssql tcp/ip ports, not the default one (1433). My current connection string is:

Provider=SQLOLEDB.1;Password='+sedit2.Text+';Persist Security Info=True;User ID='+sedit1.Text+';Initial Catalog=GAMEDB;Data Source='+scombobox1.Text

Thanks
0
Comment
Question by:cypherbad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 250 total points
ID: 22796478
servername\insteancename,portnumber

So if it's a default isntance.

servername,1234
0
 
LVL 1

Author Comment

by:cypherbad
ID: 22796498
I didn`t quite get it where to place the comma so if you can insert it in my connection string posted would be great.

Many Thanks,
Cypher
0
 
LVL 28

Assisted Solution

by:2266180
2266180 earned 250 total points
ID: 22796506
this site has saved me a bunch of times when I was in this kind of situation: http://www.connectionstrings.com/

what you need to change is:

Provider=SQLOLEDB.1;Password='+sedit2.Text+';Persist Security Info=True;User ID='+sedit1.Text+';Initial Catalog=GAMEDB;Data Source='+scombobox1.Text+','+portEdit.text
0
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 
LVL 28

Expert Comment

by:2266180
ID: 22796517
2 minutes too late -_-
0
 
LVL 1

Author Comment

by:cypherbad
ID: 22796519
Thanks i got it know.
0
 
LVL 1

Author Closing Comment

by:cypherbad
ID: 31509663
Thanks ciuly for the example, but since BrandonGalderisi told me the same thing but harder to understand i give to both of you half.
0
 
LVL 1

Author Comment

by:cypherbad
ID: 22796551
Congrats on your genius rank, i kinda know u from a romanian forum... :P
0
 
LVL 28

Expert Comment

by:2266180
ID: 22796571
thanks :)

tell me your username so I can ban you :drac:
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question