Weird Problem with opening DSN

Results 1 to 3 of 3

Thread: Weird Problem with opening DSN

  1. #1
    Join Date
    Dec 1969

    Default Weird Problem with opening DSN

    I&#039;m getting some weird results with my code when opening my Access DB. <BR><BR>Here&#039;s the code <BR>&#060;% <BR>Dim objConn <BR>Set objConn = Server.CreateObject("ADODB.Connection") <BR>objConn.ConnectionString = "DSN=Pictures.dsn" <BR>objConn.Open <BR>%&#062; <BR><BR>Here&#039;s the error; <BR>Error Type: <BR>Provider (0x80004005) <BR>Unspecified error <BR>/openDB.asp, line 6 <BR><BR>The weird part is when I make a minor change to the HTML code and click the link to the page which contains this code, it seems to work fine. But then when I hit refresh...I am getting the error. I am closing the connection with; <BR><BR>&#060;% <BR>ObjConn.Close <BR>Set objConn = Nothing <BR>%&#062; <BR><BR>Any help would be appreciated....Thanks!

  2. #2
    Join Date
    Dec 1969

    Default Try this

    Dim objConn <BR>Set objConn = Server.CreateObject("ADODB.Connection") <BR> "DSN=Pictures.dsn" <BR>%&#062; <BR><BR>

  3. #3
    Tony Guest

    Default RE: Weird Problem with opening DSN

    Looks like you are using a system DSN, try a direct connection to your Database IE:<BR><BR>Dim objConn<BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=C:DatabaseDatabaseBD.mdb;" & "UID=admin;PWD=;"<BR>objConn.Open<BR><BR><BR>T his has worked for me and this DSN is hard coded into the Template.<BR><BR><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