Results 1 to 7 of 7
  1. #1
    Join Date
    May 2006
    Posts
    3

    Unanswered: sql server does not exist or access is denied

    Hello every one,

    i m facing one problem while connecting to sql server (Local database )on my computer through vb.net.........
    with the same query i m able to connect my remote sql server.........

    i have checked for user name,password .it is correct....
    ip address of sql server is ok.........
    tcp/ip connection is set with port 1433......
    no firewall is set up.my sql query is like this.........

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

    can any one plz help me in solving this problem.......

    Thanks in advance,
    Bharat.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Try removing the port from your connection string:
    Code:
    connectstr="data source=192.168.1.58;persist security info=false;initial catalog=wincash1db;user id=bharat;password=******"

  3. #3
    Join Date
    May 2006
    Posts
    3
    i must need to keep port no otherwise im doing by removing port no..but for that i have to update this change into so many files......but why it is not connecting with port no exist....
    can u plz let me know.......

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    I am not sure I understand. Did the suggestion work?

  5. #5
    Join Date
    May 2006
    Posts
    3
    hello,
    My question is it should work with port no.
    every thing for connectstring is looking good.....
    i already tried by removing port no.but that what i was doing previously and it is a tedious process for me to change whole string change every time when i have to change my code on local machine..( for that i need to change in all files where i m using connect string)....
    i wnat to remove that headache .thats why i found if this can work half of my time will be reduced..........
    I guess mow it would be more clear to u

    Thanks,
    Bharat.

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    When a client connects to a default instance of SQL Server, it assumes it will be connecting to port 1433. If you try to connect to a named instance, there is a resolver service listening on port 1434 that will direct the client to the proper port. The only way I know of of needing the port number in the connection string is if you connect with DBLib. Otherwise, it is pretty automatic.

    A better way of dealing with connection strings in multiple places all around your application is to use configuration files, whether they are global.asa files, include files, or some sort of XML configuration file that .NET likes to use. You may want to take this opportunity to introduce this in your application so the next time this happens, you only have to change the configuration file.

  7. #7
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    First check or get information about what protocols have been enabled on SQL Server, sometimes you may not be able to use TCP/IP to connect and in that case named-pipes is only way out.

    Go thru thsi KBA http://support.microsoft.com/kb/328306/en-us for further information to resolve the error.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •