Troubles connecting to DSN

Results 1 to 2 of 2

Thread: Troubles connecting to DSN

  1. #1
    Dave Chappuis Guest

    Default Troubles connecting to DSN

    &nbsp;<BR>I&#039m working on a PC, Win95. I made a DSN on the WinNT Server 4.0. It is called Jobsvac.dsn, a System DSN. I&#039m working with the System Administrator who has access to the server.<BR><BR>I&#039m using this code to connect to the DB in a file called employ4.asp:<BR><BR> &#060;%<BR> Set MyConn=Server.CreateObject("ADODB.Connection")<BR> MyConn.Open "jobsvac","Guest","Guest"<BR> Set RS=MyConn.Execute("Select REQ NO From Jobs")<BR> Response.Write(RS("REQ NO"))<BR> MyConn.Close<BR> &#037;&#062; <BR>The file is called employ4.asp and is on the server in the website directory.when I ran the page within the browser by typing - WWW.plansys.com/employ4.asp, I recieved this error<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039<BR><BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified/employ4.asp, line 15<BR><BR><BR>Another problem, to get this message again, the System Admin. has to reboot the server.I can not get this error message again until he reboots the serve! Otherwise, when I run the code again, the browser just hangs as if it is looking and can&#039t find anything. Then I press stop and the TRANSACTION STOP error appears. <BR><BR>I don&#039t understand how the server is working.<BR><BR>Can any one help me, Dave

  2. #2
    Join Date
    Dec 1969
    Posts
    1,912

    Default RE: Troubles connecting to DSN

    You might try setting it up this way:<BR><BR>&#060;%<BR><BR>Set RS = Server.CreateObject("ADODB.Recordset")<BR>connectm e = "DSN=jobsvac"<BR><BR>SQLstmt = "SELECT REQNO From Jobs" &#039 I&#039m pretty sure your <BR>&#039database fields can&#039t have spaces Ex: REQ NO --> REQNO<BR><BR>RS.open SQLstmt, connectme,"Guest","Guest"<BR><BR>while not rs.EOF<BR> Response.Write RS("REQNO") & "<BR>"<BR>wend<BR><BR>RS.Close<BR>Set RS = Nothing<BR>&#037;&#062;<BR>

Posting Permissions

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