Accessing SQL using a connection string

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jeggebeen
    Junior Member
    • Jan 2008
    • 1

    Accessing SQL using a connection string

    The sql databases are hosted on different boxex than the websites. If I configure an active server page on the website to access the sql database on another server, what username/password would I use?

    Is there any problem with trusted connections between the website and database or account delegations problems? For example, annonymous access to the website still uses a user account. If the connection string uses a different user account, will there be a failure to connect?
  • John_Accuwebhosting
    Senior Member
    • Jun 2006
    • 120

    #2
    Re: Accessing SQL using a connection string

    It should not create any issues. You can get the username and password to access your MS SQL database from your database hosting provider.

    Comment

    • Shane
      Senior Member
      • Jun 2006
      • 264

      #3
      Re: Accessing SQL using a connection string

      Hello Jeggebeen,

      If you have configured an ASP page to access SQL database on another server, you need to use your database username and password with database server IP address details.

      It would not be an affect if anonymous access to the website. If the connection string uses a correct user account in connection strings, then it will be working fine. For example, I have posted below mentioned connection strings:

      DSN less connection
      Dim SqlConn
      Set SqlConn = Server.CreateObject("ADODB.Connection")
      SqlConn.ConnectionString="Driver={SQL Server};"
      "Server=server IP address;"
      "Database=dbname;"
      "Uid=username;"
      "Pwd=password;"
      SqlConn.Open
      Response.Write "SQL Connection Successful"
      Last edited by admin; 08-04-2015, 09:14 AM.

      Comment

      • projectnewsinn
        Junior Member
        • Oct 2010
        • 3

        #4
        AccuWeb.Cloud
        Re: Accessing SQL using a connection string

        i agree with this person I didn't realise you didn't have any VB skills, if this is the case then DSN-less connections are probably not the way to go, unfortunately these require a good knowledge of VB and it is not just a case of me being able to tell you what to type and where as it will need customizing for you database and SQL Server...

        I would suggest playing around with the options in the ODBC connection; possibly start by creating a new test connection. At the end of the connection wizard there is a Test Connection button that will help you know if you have the settings correct. This is done in Control Panel > Admin Tasks > Data Sources (ODBC).

        The SQL Login box you are getting is part of the ODBC Connection and has nothing at all to do with Access. In fact you would get this box whatever program you used to connect to the ODBC Connection, Access or other.

        My immediate guess is that the username / password you have in your ODBC Connection is incorrect and does not correspond to an SQL User that is setup on your SQL Server, this can be entered on the second page of the ODBC Connection Wizard.

        Comment

        Working...
        X