[thelist] ASP Database Problem. Any Ideas?
Eric Engelmann
eric at geonetric.com
Mon Sep 25 11:38:55 CDT 2000
Got to append the *values* of your variables to the SQL string. You don't
want to put 'LU' in the database.
SequelFunction = "INSERT INTO Links (LinkURL, LinkName, LinkBlurb,
DateAdded) VALUES ('" & LU & "','" & LN & "','" & LB & "','" & LDA " &')"
Make sure you Replace() any apostrophes, quotes in your form values first
with double apostrophes or double quotes. There's an article on Evolt about
this somewhere. (e.g. if someone puts "It's" in a form field, it'll hose
your SQL string).
Best solution - if you're using SQL server, use a stored procedure.
Also the date might not work depending on how you've got it setup in your db
(string vs date or whatever).
-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Bailey, Dan
Sent: Monday, September 25, 2000 10:45 AM
To: 'thelist at lists.evolt.org'
Subject: [thelist] ASP Database Problem. Any Ideas?
Okay, here's my code:
LU = Request.Form ("URL")
LN = Request.Form ("prefix")
LB = Request.Form ("blurb")
LDA = Date
Set Connect = Server.CreateObject ("ADODB.Connection")
Connect.Open "Fonto"
SequelFunction = "INSERT INTO Links (LinkURL, LinkName, LinkBlurb,
DateAdded) VALUES (LU, LN, LB, LDA)"
Connect.Execute SequelFunction
And for some reason, it ain't working. There's a 5th field in the database,
which is an AutoNumber, but here's the error message I'm getting:
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 4.
/addlink.asp, line 20
Ideas, anyone?
---------------------------------------
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