Forum Moderators: mack
Any help is appreciated. I know ASP.net but never actually learned ASP. Due to the server the site is going to be hosted on I cannot use ASP.net. I am trying a simple access database insert. The database has a table called PageContent. It has two fields:
Heading = Text
Content = Memo
Here is the code I am using:
<%@ LANGUAGE="VBScript" %>
<HTML>
<HEAD>
<TITLE>DATABASE INSERT</TITLE>
</HEAD>
<BODY><% If request("REQUEST_METHOD") <> "POST" then %>
<h1>Leave message</h1>
<FORM ACTION="addition.asp" METHOD="post">
<TABLE>
<TR><TH>Heading: <TD><INPUT NAME="MessageHeading" SIZE=50>
<TR><TH>Content: <TD><INPUT NAME="MessageContent" SIZE=50>
</TABLE>
<INPUT TYPE="submit" VALUE="SUBMIT">
<INPUT TYPE="reset" VALUE="RESET">
</FORM><% Else
' Data Entry
Set Cnn = Server.CreateObject("ADODB.Connection")
Set CnnRS = Server.CreateObject("ADODB.Recordset")Cnn.Open "123"
CnnRS.Open "SELECT * FROM PageContent", _
Cnn, adOpenDynamic, adLockOptimistic, adCmdText
CnnRS.AddNew
CnnRS("Heading") = request("MessageHeading")
CnnRS("Content") = request("MessageContent")
CnnRS.Update %>CnnRS.Close
Cnn.Close
Set CnnRS = Nothing
Set Cnn = Nothing<h1>Thank You</h1>
<% End If %>
<hr>
<a href="default.asp">Back</a></BODY>
</HTML>
Here is the error message I am getting
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/sites/123/addition.asp, line 27
Any help is greatly appreciated.
Thanks.
Chris.