Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2003
    Posts
    10

    Unhappy Unanswered: sql server registration and authentication

    hi:

    recently i have intsalled sql server on my system . and tried to set the sql server authentication, but its giving me an error,all the time i.e not allowing me to register and it says, "not connected to the right server." or sql server is not found.

    can any one help me out ASAP with this.that is show me how to register the sql server exactly and set the user name and password for the sql server.Thnaks.

  2. #2
    Join Date
    Feb 2004
    Location
    PAKISTAN
    Posts
    106
    R u tryin to register locally or remotely? Try to register the server locally with local-Admin account and make sure the name of the sql server is correct. By default authentication mode is set to windows, accessing through local-admin would help u identify the problem. U may also check wether the service is running or not and check the service agent account too.

  3. #3
    Join Date
    Oct 2003
    Posts
    10
    hi:
    thankyou for your response.
    i could not set (local) sql server.and the only one available is
    "SAC-9UJRH6LO5DY".i used this server and in the queryy analyzer, i tried to set sql server username and password.but its not allowing me to do that, as its saying server not available.cxan you please send me the details how can i set both remotely using the server name i used at the top and locally.thanks.

  4. #4
    Join Date
    Feb 2004
    Location
    PAKISTAN
    Posts
    106
    First of all u need to check if the sql is running or not.
    Then u need to make sure if SQL is set to Mixed mode, for u r trying to give username password, use windows authentication instead to connect.
    If ur sql service is running and is using System Account to start the service u must be able to connect locally through local Admin user on the machine by using windows authentication.
    It's rather difficult to identify where the problem resides unless u go through these steps.

  5. #5
    Join Date
    Oct 2003
    Posts
    10
    Originally posted by TALAT
    First of all u need to check if the sql is running or not.
    Then u need to make sure if SQL is set to Mixed mode, for u r trying to give username password, use windows authentication instead to connect.
    If ur sql service is running and is using System Account to start the service u must be able to connect locally through local Admin user on the machine by using windows authentication.
    It's rather difficult to identify where the problem resides unless u go through these steps.


    hi:

    as u said in the query anylazer is used the sql server = (local) and used windows authentication to retrieve the database.i could see all the all the databse in the sql server, i.e Northwind, master etc.i tried ti use vb.net coding to connect to this sql server.but it says login failed or unknown server.i have enclosed the code i used to connect to this server.could you please let me know where the mistake could be.

    Imports System.Data.SqlClient

    Public Class Form1
    Inherits System.Windows.Forms.Form
    Private Sub connectsql()
    Dim cnNwind As New SqlConnection()
    Dim strserver, strDB, strUsername, strpwd As String

    strserver = "(local)"
    strDB = "Northwind"
    strUsername = "cdburn"
    strpwd = "cd"

    Try
    cnNwind.ConnectionString = "server=" & _
    strserver & ";database=" & _
    strDB & ";" & _
    "Username=" & strUsername & ";Password=" & _
    strpwd & ";Connection Timeout = 15;"

    cnNwind.Open()
    MessageBox.Show("connected successfully.")
    Catch exc As Exception
    MessageBox.Show(exc.Message.ToString())
    Finally
    cnNwind.Close()
    MessageBox.Show("Disconnected successfully")
    End Try
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    connectsql()
    End Sub
    End Class

  6. #6
    Join Date
    Feb 2004
    Location
    PAKISTAN
    Posts
    106
    In the queryanalyzer type in:
    SELECT SERVERPROPERTY('SERVERNAME')
    Executing the statement would let u know the correct instance name. Use that instance to register in the Enterprise-Manager and choose Windows-Authentication. Check wether the login "cdburn" exists in the Security=>Logins tab in the EM. Reset the password too.
    Go to Northwind Db=>Users and choose the properties of "cdburn" user, if it doesn't exist; create it and assign DB-Owner rights to it.

    Then try to connect through this user and use the correct server name not "local" in ur coding.

  7. #7
    Join Date
    Oct 2003
    Posts
    10
    hi:

    here is what i did.in the query analyzer i typed: SELECT SERVERPROPERTY('SERVERNAME'), and received the server name: "SAC-9UJRH6LO5DY".i used this server name to register in the enterpise manager.i could register successfully.and i checked the EM security =>logins for user login and i could see the SACCORP\CDBURN login name.later i went to Northwind DB => Users and Choose the user name CDBURN and assigned DB-OWNER to it.later i used the vb.net code below to connect it, but wheN i ran the program, its giving me a message , "sql server does not exist or access denied".the user name and pwd is the the same as the windows username and passwd.

    Imports System.Data.SqlClient

    Public Class Form1
    Inherits System.Windows.Forms.Form
    Private Sub connectsql()
    Dim cnNwind As New SqlConnection()
    Dim strserver, strDB, strUsername, strpwd As String

    strserver = "(SAC-9UJRH6LO5DY)"
    strDB = "Northwind"
    strUsername = "SACCORP\CDBURN"
    strpwd = "cd"

    Try
    cnNwind.ConnectionString = "server=" & _
    strserver & ";database=" & _
    strDB & ";" & _
    "User ID=" & strUsername & ";pwd=" & _
    strpwd & ";Connection Timeout = 15;"

    cnNwind.Open()
    MessageBox.Show("connected successfully.")
    Catch exc As Exception
    MessageBox.Show(exc.Message.ToString())
    Finally
    cnNwind.Close()
    MessageBox.Show("Disconnected successfully")
    End Try
    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    connectsql()
    End Sub
    End Class



    could you please let me know what the mistake could be.thanks.

  8. #8
    Join Date
    Feb 2004
    Location
    PAKISTAN
    Posts
    106
    Dear shaikh, I don't think u can code windows-user name like this. SQL doesn't require further authentication for a trusted connection nor do u need to mention the password. Create SQL user CDBURN and assign the same rights to it in the database. Use this user and its password in ur coding instead. Also make sure that u've TCP/IP protocol enabled and at ur server by checking the Server-Network-Utitlity and SQL is listening to default port 1433.

Posting Permissions

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