neicy62
asked on
Insert error
Hi
I have developed a web page in dreamweaver and am getting a error when trying to insert information. It is a access 2000 database. This is the error when I am running the page in explorer.
This is the insert statment....
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO Request(School, School_Priority, Date, Improvement, Rational, Estimated_Cost, Employee_Id) VALUES (?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.Confi gurationSe ttings.App Settings(" MM_CONNECT ION_STRING _connEnhan cement") %>'
DatabaseType='<%# System.Configuration.Confi gurationSe ttings.App Settings(" MM_CONNECT ION_DATABA SETYPE_con nEnhanceme nt") %>'
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "request Added.aspx" %>'
Debug="true"
Please help, the error in explorer says System.Dat.OleDb.OleDbExce ption:Synt ax error in INSERT INTO statement
Thanks
Denise
I have developed a web page in dreamweaver and am getting a error when trying to insert information. It is a access 2000 database. This is the error when I am running the page in explorer.
This is the insert statment....
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO Request(School, School_Priority, Date, Improvement, Rational, Estimated_Cost, Employee_Id) VALUES (?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.Confi
DatabaseType='<%# System.Configuration.Confi
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "request Added.aspx" %>'
Debug="true"
Please help, the error in explorer says System.Dat.OleDb.OleDbExce
Thanks
Denise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hey there...
Just wondering if anyone could help me with my problem
Thanks
Denise
Just wondering if anyone could help me with my problem
Thanks
Denise
ASKER
Hi there...
Have not heard back still wondering if anyone can help with my problem.
Thanks
Denise
Have not heard back still wondering if anyone can help with my problem.
Thanks
Denise
ASKER
Hi
You can close this question 0 points awarded, figured it out for myself
Thanks
Denise
You can close this question 0 points awarded, figured it out for myself
Thanks
Denise
ASKER
I tried that but not sure were to put statment in code. I did something to and now I am getting an error of
SystemData.OleDb.OleDbExce
Operation must use an updateable query.
Here is the code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrl
<MM:Insert
runat="server"
CommandText='<%# "INSERT INTO Request (Employee_ID, Estimated_Cost, Improvement, Rational, Request_Date, School, School_Priority) VALUES (?, ?, ?, ?, ?, ?, ?)" %>'
ConnectionString='<%# System.Configuration.Confi
DatabaseType='<%# System.Configuration.Confi
Expression='<%# Request.Form("MM_insert") = "form1" %>'
CreateDataSet="false"
SuccessURL='<%# "request Added.aspx" %>'
Debug="true"
><Parameters>
<Parameter Name="@Employee_ID" Value='<%# IIf((Request.Form("Employe
<Parameter Name="@Estimated_Cost" Value='<%# IIf((Request.Form("Estimat
<Parameter Name="@Improvement" Value='<%# IIf((Request.Form("Improve
<Parameter Name="@Rational" Value='<%# IIf((Request.Form("Rationa
<Parameter Name="@Request_Date" Value='<%# IIf((Request.Form("Date") <> Nothing), Request.Form("Date"), "") %>' Type="Date" />
<Parameter Name="@School" Value='<%# IIf((Request.Form("School"
<Parameter Name="@School_Priority" Value='<%# IIf((Request.Form("School_
</Parameters>
</MM:Insert>
<MM:DataSet
id="dsschool"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%# System.Configuration.Confi
DatabaseType='<%# System.Configuration.Confi
CommandText='<%# "SELECT School_Name FROM Building" %>'
Debug="true"
>
<Parameters>
<Parameter Name="@school" Value='<%# IIf((Request.QueryString("
</MM:DataSet>
<MM:PageBind runat="server" PostBackBind="true" />
<!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">
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #00CC99;
}
-->
</style></head>
<body>
<h1 align="center">Add New Building Enhancement Request</h1>
<p> </p>
<p> </p>
<p> </p>
<form method="post" name="form1" runat="server">
<table align="center">
<tr valign="baseline">
<td width="164" align="right" nowrap>Date:</td>
<td width="210"><asp:textbox id="Date" TextMode="SingleLine" Columns="32" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Employee_ID:
<td><asp:textbox id="Employee_ID" TextMode="SingleLine" Columns="32" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Estimated_Co
<td><asp:textbox id="Estimated_Cost" TextMode="SingleLine" Columns="32" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Improvement:
<td><asp:textbox id="Improvement" TextMode="MultiLine" Columns="32" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Rational:</t
<td><asp:textbox id="Rational" TextMode="MultiLine" Columns="32" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">School:</td>
<td><% School.SelectedIndex = School.Items.IndexOf(Schoo
<asp:dropdownlist id="School"
DataSource="<%# dsschool.DefaultView %>"
DataTextField="School_Name
DataValueField="School_Nam
runat="server"> </asp:dropdownlist>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">School_Prior
<td><asp:textbox id="School_Priority" TextMode="SingleLine" Columns="32" runat="server" />
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td><input type="submit" value="Insert record"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>
<p> </p>
</body>
</html>
Thanks for the help
Denise