Database connectivity error

Discussion in 'ASP General' started by JonH, Apr 26, 2004.

  1. JonH

    JonH Guest

    I am getting a HTTP 500.100 error when trying to log data to an MS Access Database through my ASP page. The error is below in full as is my ASP code.

    **This ONLY happens for less than a minute after someone else has logged data through the ASP page, and doesn't happen every time, so I believe its possibly the way I am establishing connection or I'm not closing something correctly?*

    Any ideas how to stop this error from happening because once this goes live lots of people will be using it and they won't want to wait a minute or so to hit refresh

    Error

    The page cannot be displayed
    There is a problem with the page you are trying to reach and it cannot be displayed.

    -------------------------------------------------------------------------------

    Please try the following

    Click the Refresh button, or try again later

    Open the dilithium home page, and then look for links to the information you want.
    HTTP 500.100 - Internal Server Error - ASP erro
    Internet Information Service

    -------------------------------------------------------------------------------

    Technical Information (for support personnel

    Error Type
    Provider (0x80004005
    Unspecified erro
    /serverlog/insertrecord.asp, line 2

    Browser Type
    Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; .NET CLR 1.0.3705)

    Page
    POST 81 bytes to /serverlog/insertrecord.as

    POST Data
    reason=ergreg&CompName=DILITHIUM&UName=Administrator&OS=Windows2000&action=Logoff

    Time
    Friday, April 23, 2004, 2:15:17 PM
    ----------------------------------------------------------------

    ASP Code

    <HTML><BODY><
    'declare your variable

    servername = Request.Form("CompName"
    username = Request.Form("UName"
    reasons = Request.Form("reason"
    actiontype = Request.Form("action"
    operatingsystem = Request.Form("OS"

    dim connectio
    dim sSQL,sConnStrin

    'declare SQL statement that will query the databas

    set connection = server.createobject ("adodb.connection"

    sSQL="INSERT INTO Log (Username,reason,action,server) VALUES ('" & replace(username,"'","''") & "','" & replace(reasons,"'","''") & "','" & replace(actiontype,"'","''") & "','" & replace(servername,"'","''") & "')

    'define the connection string, specify database
    ' driver and the location of databas

    'Open the connection to the databas
    connection.Open("DSN=changecontrol"

    'execute the SQ
    connection.execute(sSQL

    'close the object and free up resource
    Connection.Clos
    Set Connection = Nothin
    %><script language="Javascript"

    if ("<%=operatingsystem%>" == "Windows2000"

    if ("<%=actiontype%>" == "Logoff"

    var obj = new ActiveXObject("LaunchinIE.Launch")
    obj.LaunchApplication("c:\\shutdown\\shutdown.exe -l -f")

    else if ("<%=actiontype%>" == "Shutdown"

    var obj = new ActiveXObject("LaunchinIE.Launch")
    obj.LaunchApplication("c:\\shutdown\\shutdown.exe -u -f")

    else if ("<%=actiontype%>" == "Restart"

    var obj = new ActiveXObject("LaunchinIE.Launch")
    obj.LaunchApplication("c:\\shutdown\\shutdown.exe -r -f")


    els

    var obj = new ActiveXObject("LaunchinIE.Launch")
    obj.LaunchApplication("logoff")


    </script></BODY></HTML>
     
    JonH, Apr 26, 2004
    #1
    1. Advertising

  2. JonH

    Ray at Guest

    Don't use a DSN. Use an OLEDB connection string as illustrated at
    www.connectionstrings.com. Then, make sure that your IUSR account has
    read/write NTFS permissions on the directory that the MDB is in (as well as
    the mdb itself).

    Also, please see: http://www.aspfaq.com/show.asp?id=2109

    Ray at work

    "JonH" <> wrote in message
    news:...
    > I am getting a HTTP 500.100 error
    >
    > Error Type:
    > Provider (0x80004005)
    > Unspecified error
    >
    > set connection = server.createobject ("adodb.connection")
    > connection.Open("DSN=changecontrol")
     
    Ray at, Apr 26, 2004
    #2
    1. Advertising

  3. JonH

    JonH Guest

    Thanks for the reply Ray. I've implented it as described and so far so good.
     
    JonH, Apr 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gpeacock

    ASP database connectivity KB253604

    gpeacock, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    342
    Michael Evanchik
    Nov 10, 2003
  2. Steven Caliendo

    MySQL database connectivity

    Steven Caliendo, Dec 17, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    440
    dryer
    Dec 18, 2003
  3. Niks

    Database Connectivity using DSN

    Niks, Dec 22, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    10,862
    Kevin Spencer
    Jan 12, 2004
  4. Arun K

    Database Connectivity using DSN

    Arun K, Dec 22, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    401
    Natty Gur
    Dec 23, 2003
  5. C Newby

    Database Connectivity Problem ...

    C Newby, Apr 16, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    316
    C Newby
    Apr 16, 2004
Loading...

Share This Page