Database connection to another server

Results 1 to 2 of 2

Thread: Database connection to another server

  1. #1
    Join Date
    Dec 1969
    Posts
    67

    Default Database connection to another server

    &nbsp;<BR>My asp scripts are running on one server and my sql server database is on another server.How do i connect to the database.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Database connection to another server

    Well, how were you doing it before? With a System DSN? With a DSN-less connection? If you are using a DSN-less connection and connecting to a SQL Server on another box, you can do:<BR><BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .ConnectionString = "DRIVER={MS-SQL Server};SERVER=ServerName;DATABASE=DatabaseName;UI D=UserName;PWD=Password;"<BR>objConn.Open<BR><BR>I f you are using a System DSN, just go through the standard DSN setup (Start/Settings/Control Panel/ODBC Data Sources) and set up your DSN to access a database on another machine.

Posting Permissions

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