[thelist] ASP Question

Michael CAREY giles at elementdesign.fsnet.co.uk
Fri Oct 11 00:47:01 CDT 2002


--
[ Picked text/plain from multipart/alternative ]
Hi there. I am an ASP newbie so dont bite my head off if this is a silly mistake.

My code to do a simple db update looks like this
-----------------------------------------------------------------------------------------------------------------------
<%
Dim objconn, strprovider, sql
Set objconn = Server.CreateObject("ADODB.Connection")
strprovider = "Driver=Microsoft Access Driver (*.mdb); DBQ=e:\domains\elementdesign.dc-hosting.co.uk\user\htdocs\display\update.mdb"
objconn.Open(strprovider)

'Server Side form validation to keep our database clean
straddr = request.form("PostedBy")
strmsg= request.form("Message")
strip = request.form("IpAddr")
strday = request.form("Day")


sql = "INSERT INTO stuff(PostedBy,IpAddr,Day,Message) VALUES ('"&straddr&"','"&strday&"','"&strip&"','"&strmsg&"')"

objconn.Execute(sql)


'Lets redirect the user back to where they came from
Response.Redirect "thanks.htm"
%>
----------------------------------------------------------------------------------------------------------------------------------------------------------------

My database is called update with a table in it called stuff. I have four columns
PostedBy, IpAddr, Day, Message in that order.
I have this page linked into a form, from which the results are stored.
However, I keep getting the following error

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/display/add.asp, line 16



I really am stuck on this one. It has taken me a long time to get my connection right but i finally have but there are still errors.



There is a test version at www.elementdesign.dc-hosting.co.uk/display/addit.asp

Please please please help.

Thanks in advance.

Giles Carey  giles at elementdesign.biz  www.elementdesign.biz





--




More information about the thelist mailing list