This is not working... I have an MDB MSAccess 2000 file called database.mdb. I have a table called news_items, and the two fields i am pulling from the form are "date" and "news".
here is the asp code that generates a HTTP 500 Internal Error
<%
Dim date, news, data_source, con, sql_insert
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''"
End Function
date = ChkString(Request.Form("date")
news = ChkString(Request.Form("news")
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb"
sql_insert = "insert into news_items (date, news) values ('" & date & "', '" & news & "')"
Set con = Server.CreateObject("ADODB.Connection"
con.Open data_source
con.Execute sql_insert
con.Close
Set con = Nothing
%>
here is the asp code that generates a HTTP 500 Internal Error
<%
Dim date, news, data_source, con, sql_insert
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''"
End Function
date = ChkString(Request.Form("date")
news = ChkString(Request.Form("news")
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb"
sql_insert = "insert into news_items (date, news) values ('" & date & "', '" & news & "')"
Set con = Server.CreateObject("ADODB.Connection"
con.Open data_source
con.Execute sql_insert
con.Close
Set con = Nothing
%>