Link to home
Start Free TrialLog in
Avatar of shitbhar
shitbhar

asked on

sql server connection problem

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."
Avatar of quanmac
quanmac

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.
Avatar of shitbhar

ASKER

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.
Ok, can you post your connection string so I can take a look at it?
Uhm... Are you using sqlserver or mde? MDE needs some tweaking for acceptig connections.
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.
ASKER CERTIFIED SOLUTION
Avatar of quanmac
quanmac

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial