[thelist] ASP Question

Anthony Johnston . Antix tech at antix.co.uk
Fri Oct 11 03:04:01 CDT 2002


put spaces round the string appends '&' if you don't vb thinks
the bit before is a long (or something old vb)

so "','" & varname & "','" etc..

cheersears,  Ant.

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Michael CAREY
Sent: 11 October 2002 06:42
To: thelist at lists.evolt.org
Subject: [thelist] ASP Question


--
[ 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





--

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !




More information about the thelist mailing list