The following insert statement causes the script to fail. When I try to run the script on my local machine and one other server it works perfectly. On others, I receive the usual HTTP 500 - Internal server error. Can anyone tell me why it works on some servers and not others?!?!
Code:
<%@ LANGUAGE = VBScript %>
Code:
<% Option Explicit %>
<%
'******************************************************************************
function RemoveCharacters()
dim frm,item
Set frm = Server.CreateObject("Scripting.Dictionary")
frm.CompareMode=1
For each Item in Request.Form
frm.Add Cstr(Item), Replace(Request.Form(Item),"'","''")
Next
Set RemoveCharacters = frm
End Function
'******************************************************************************
%>
<%
Dim ObjConn
Dim ObjRecSet
Dim FilePath
Dim Statement
Dim RMV
Dim DateVar
Dim TimeVar
Dim Title
DateVar = Date()
TimeVar = Time()
Set RMV = RemoveCharacters()
'Path of Database
FilePath = Server.MapPath("Journal.mdb")
'Create Connection with DB
Set ObjConn = Server.CreateObject("ADODB.Connection")
ObjConn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & FilePath
if request("JournalAddTitle") = "" then
Title = "Default News Title"
else
Title = RMV("JournalAddTitle")
end if
Statement = "Insert into tbl_JournalNews(JournalDate, JournalTime, JournalUser, JournalTitle, JournalNews) values('" & DateVar & "', " & TimeVar & "', '" & request("JournalAddUser") & "', '" & Title & "', '" & RMV("JournalAddNews") & ")"
ObjConn.Execute(Statement)
Thanks!