[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

sql server connection problem

Posted on 2006-05-17
10
Medium Priority
?
314 Views
Last Modified: 2010-04-17
Hello every one,

can any one plz let me know why this connectstr is not working?????/

im trying to connect to my local database server installed on my pc.........

with this string i can connect to the remore sql server...it is working.........
for local databse i created user.......
no firewall is installed........
tcp/ip port 1433 and named pipes protocols are selected from sqlserver......
database instance is created locally........

i can connect to my local database by its name but with ip address it is not connecting and im getting error of "SQL Server not exist or user dont have right to access it."
0
Comment
Question by:shitbhar
  • 3
  • 3
  • 2
8 Comments
 
LVL 3

Expert Comment

by:quanmac
ID: 16702412
Have you made sure the user you are connecting with has the rights to connect the sql server?

Try using localhost instead of the name or ip address.
0
 

Author Comment

by:shitbhar
ID: 16703084
hello,
but if i try with local host then i have to remove port no too.and for this change i have to update in so many paces in my code .so i donot wnat to do that.
yes.user has all rights......

but why it is not working with ip addresss.....it should work.where i m amaking mistake.......


can u plz try something else ......


thanks,
bharat.
0
 
LVL 3

Expert Comment

by:quanmac
ID: 16703124
Ok, can you post your connection string so I can take a look at it?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 7

Expert Comment

by:SoyYop
ID: 16703402
Uhm... Are you using sqlserver or mde? MDE needs some tweaking for acceptig connections.
0
 

Author Comment

by:shitbhar
ID: 16704216
connectstr="data source=192.168.1.58,1433;persist security info=false;initial catalog=wincash1db;user id=bharat;password=bharat"

i already set user rights to access databse ,modify it...whatever all rights is set...
no firewall set on that pc.........
tcp/ip named pipes port forwarding is there.........

with this string i can connect to our remote sql server( by changing its ip address.......)

i guess this will information will help u a lot.......

Thanks,
Bharat.
0
 
LVL 3

Accepted Solution

by:
quanmac earned 100 total points
ID: 16704373
If you can connect to a remote server and not to your local server, then I would change the connection string to this:

constr = "workstation id=YourSQLServerDBName;packet size=4096;user id=bharat;data source=YourSQLServerDBName;persist security info=True;initial catalog=wincash1db;password=bharat";

I use this connection string when I want to connect to my local server and when I connect to a remote server I use the format you have.

This works fine for me, so give it a try.
0
 

Author Comment

by:shitbhar
ID: 16704501
but is this the one with i can connect to my remote server ??? if yes then its good suggestion .otherwise i have to look another solution....in above string u said that
workstation id and data source ...........if for both of this data source is same then how it will work for my remote server.........i guess for work staion id = local database name and for data source =rermote server ip address.......but one thing is missing here the port no...without specifying port how it will works with remote server..this what i a m guessing from yr suggestion.......plz guide me if i have mis understood.
and Thanks for yr time and yr valuable suggestion too.......

Thanks,
Bharat.
0
 
LVL 7

Assisted Solution

by:SoyYop
SoyYop earned 100 total points
ID: 16708225
workstation id=your coumputer name

Go and see this site:

http://www.connectionstrings.com/


Again, which version of SQL server are you using? Seems 2005 have remote connections disabled by default and you need to run an utility to enable them. NOT JUST TELL IT TO ENABLE THE PROTOCOL, BUT REMOTE CONNECTIONS OVER THE PROTOCOL.

Luck,
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

872 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