none
How I Connect Ms SQL Server 2005 From Client Computer

    Question

  • Dear Expert,


    I am working on a domain network. I have the Microsoft SQL server 2005 database installed in the server.  I need some other users to get access to this database from their computers.How can I do that?

     

    Thanks

    From

    Ashim (India)

    Friday, April 11, 2008 3:20 PM

Answers

  • Your question is not clear. Programmatically? There ar emany ways depending on your program which has to be written in a 2-Tier or N-Tier architeture.

    One simple way is through ODBC using SQLConnect(), or SQLStringConnect() and SQLExec()
    Manually they would have to use a tool like iSQL or similar.

    Please be more specific on your needs and intent.

    Friday, April 11, 2008 4:46 PM
  • The asiest answer is to use a System DSN. DSNs are created by entering data into the Windows Registry and you can export the settings from one using the RegEdit "Export" function. To install it on another machine you only need to run the .REG file on each machine.

     

    Note that user names and passwords are NOT stored as part of a DSN - merely the information needed to locate the server and connect to it. Whether you are allowed to connect depends on how you set it up. You can either specify User Names & Password or use a "Trusted" connection - i.e. if the user is allowed to log into Windows their same credentials allow them into SQL Server.

     

    For more details see:

     

    http://www.devasp.com/samples/dsn_sql.asp

     

     

    Friday, April 11, 2008 6:53 PM
  • For SQL server 2005, first you need to enable remote connection and enable the protocols you need (TCP/IP,named or both). By default they are disabled.Check surface area configuration and configuration manager. SQL browser service should also be running.

    Then you can connect using the servername or ip. ie:

     

    SQLStringConnect('Driver={SQL Native Client};server=myservername\myinstance;...')

     

    SQLStringConnect('Driver={SQL Native Client};server=xxx.xxx.xxx.xxx\myinstance;...')

     

    loConn.ConnectionString = 'Provider=SQLNCLI;server==myservername\myinstance;...'

     

    loConn.ConnectionString = 'Provider=SQLNCLI;server==xxx.xxx.xxx.xxx\myinstance;...'

     

    If you're not using trusted connection then also make sure that the SQL server logins are enabled. sa login for example is not enabled automatically. Enable whichever you need.

     

     

    Saturday, April 12, 2008 10:08 AM

All replies

  • Your question is not clear. Programmatically? There ar emany ways depending on your program which has to be written in a 2-Tier or N-Tier architeture.

    One simple way is through ODBC using SQLConnect(), or SQLStringConnect() and SQLExec()
    Manually they would have to use a tool like iSQL or similar.

    Please be more specific on your needs and intent.

    Friday, April 11, 2008 4:46 PM
  • The asiest answer is to use a System DSN. DSNs are created by entering data into the Windows Registry and you can export the settings from one using the RegEdit "Export" function. To install it on another machine you only need to run the .REG file on each machine.

     

    Note that user names and passwords are NOT stored as part of a DSN - merely the information needed to locate the server and connect to it. Whether you are allowed to connect depends on how you set it up. You can either specify User Names & Password or use a "Trusted" connection - i.e. if the user is allowed to log into Windows their same credentials allow them into SQL Server.

     

    For more details see:

     

    http://www.devasp.com/samples/dsn_sql.asp

     

     

    Friday, April 11, 2008 6:53 PM
  • For SQL server 2005, first you need to enable remote connection and enable the protocols you need (TCP/IP,named or both). By default they are disabled.Check surface area configuration and configuration manager. SQL browser service should also be running.

    Then you can connect using the servername or ip. ie:

     

    SQLStringConnect('Driver={SQL Native Client};server=myservername\myinstance;...')

     

    SQLStringConnect('Driver={SQL Native Client};server=xxx.xxx.xxx.xxx\myinstance;...')

     

    loConn.ConnectionString = 'Provider=SQLNCLI;server==myservername\myinstance;...'

     

    loConn.ConnectionString = 'Provider=SQLNCLI;server==xxx.xxx.xxx.xxx\myinstance;...'

     

    If you're not using trusted connection then also make sure that the SQL server logins are enabled. sa login for example is not enabled automatically. Enable whichever you need.

     

     

    Saturday, April 12, 2008 10:08 AM