Database connectivity error

J

JonH

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top