dsn database connection

Results 1 to 2 of 2

Thread: dsn database connection

  1. #1
    Join Date
    Dec 1969

    Default dsn database connection

    Dear All,<BR><BR>My current DSN connection to the database is the following. It works fine.<BR><BR>Set Connect = Server.CreateObject("ADODB.Connection")<BR>Connect .Open "dbase"<BR><BR>My question is: I have 2 webservers <BR><BR>I wanna use 1 database for both servers. At the moment i copy the database two times. <BR><BR>When i remove the database on one server. The dsn connection won&#039;t work anymore for the sites on that machine. <BR><BR>When i try it with the following code it works fine but i prefer using DSN. Cause otherwise i have to change a lot of code<BR><BR>Set Connect = Server.CreateObject("ADODB.Connection")<BR>Set ProductSelect = Server.CreateObject("ADODB.recordset")<BR>strSourc e="Driver={Microsoft Access Driver (*.mdb)}"<BR>strSource = strSource & "; DBQ=\ntserver01databasedbase.mdb"<BR><BR>OK, shortly the question is: Is it possible to access a database from a website on another server with DSN?<BR><BR>I hope to hear soon!<BR><BR>Thnx<BR>Jane<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: dsn database connection

    Of course it is...<BR><BR>As you must be able to access the directory using the computer name (as you do in your second example), just use that string as the database location in your DSN setup...<BR><BR>Either that, or you could include that string in your application object using the global.asa file... Then you would just have to change that string each time, and not change every single page...<BR><BR>Craig.

Posting Permissions

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