Ask a Question related to Dreamweaver AppDev, Design and Development.
-
enaj #1
Insert table - ASP and access database
Hi,
I am working towards trying to insert data in to two tables from one form.
My code won't work so I have simplified everything.
I currently have a database with two tables. I have cut the tables down to
three fields each for experimentation. Using the Command dialog box I can
successfully insert into one of the tables. However I can not insert into the
second table. I have tried inserting into the second table only and am still
getting the same error message:
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/abstracts/add4.asp, line 16
I can only conclude that there is something wrong with my database. The table
in question has three fields: userid, surname, and firstname.
The code I'm using to experiment with is pasted below. I have checked and
rechecked my variables.
I'm totally stuck. Any ideas? I'm very new to all this....
THanks
Jane
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/abstracts.asp" -->
<%
if(Request.Form("surname") <> "") then Command1__sur = Request.Form("surname")
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_abstracts_STRING
Command1.CommandText = "INSERT INTO user (surname) VALUES ('" +
Replace(Command1__sur, "'", "''") + "' ) "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="">
<p>title
<input name="title" type="text" id="title">
</p>
<p>surname
<input name="surname" type="text" id="surname">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
enaj Guest
-
Using Flash to insert data into a MS Access database
Hi, first of all I am using Flash MX 2004 and have Office 2003. I am trying to use my flash form to insert data into a ms access database but it... -
Need Utility to insert a CSV to ACCESS Table
Hi Guys, first of all thanks for your help. Can someone please help me find a ColdFusion component or custom tag which will allow me to import a... -
Insert to Access database error*** Please Help
When trying to insert into access database with a form created by the standard MX2004 Insert and form wizard, get the "Syntax " error as below. Line... -
Login - multi table insert for registrant; subsquent login insert page requests into joined 'Selection' Table
Question regards insert and updates in sql server for a simple login script that requires registration the first time and only "email address" upon... -
How can I create a table in my Access database dynamically in ASP?
How can I create a table in my Access database dynamically using ASP? -
Julian Roberts #2
Re: Insert table - ASP and access database
Try using [user] instead of user. Best to rename the table though. user is a
reserved word.
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest



Reply With Quote

