ASP script does not update Access Database

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have created a ASP script using Microsoft Visual Web Developer Express
Edition 2005 that will enable users to edit a Access database in a gridview.
The script functions without any errors and allows you to edit the fields but
when you press the update button the page refreshes and the changes are lost.
I have triple checked the perms n(IUSR and IWAM) on the access db, the aspx
page and the folders and they appear correct. This is running on Windows XP
Pro with IIS for dev purposes only, after it workes correctly I will transfer
it to W2003 Server. Here is the code:


<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml"; >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="AutoNumber" DataSourceID="AccessDataSource7"
ForeColor="#333333"
GridLines="None" Height="216px" Style="z-index: 100; left: 10px;
position: absolute;
top: 121px" Width="359px">
<FooterStyle BackColor="#507CD1" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:CommandField ShowDeleteButton="True"
ShowEditButton="True" ShowSelectButton="True" />
<asp:BoundField DataField="AutoNumber"
HeaderText="AutoNumber" InsertVisible="False"
ReadOnly="True" SortExpression="AutoNumber" />
<asp:BoundField DataField="LastName" HeaderText="LastName"
SortExpression="LastName" />
<asp:BoundField DataField="Soundex" HeaderText="Soundex"
SortExpression="Soundex" />
<asp:BoundField DataField="FirstName" HeaderText="FirstName"
SortExpression="FirstName" />
<asp:BoundField DataField="MiddleInitial"
HeaderText="MiddleInitial" SortExpression="MiddleInitial" />
<asp:BoundField DataField="CaseNumber"
HeaderText="CaseNumber" SortExpression="CaseNumber" />
<asp:BoundField DataField="DOB" HeaderText="DOB"
SortExpression="DOB" />
<asp:BoundField DataField="Race" HeaderText="Race"
SortExpression="Race" />
<asp:BoundField DataField="Sex" HeaderText="Sex"
SortExpression="Sex" />
<asp:BoundField DataField="Address" HeaderText="Address"
SortExpression="Address" />
<asp:CheckBoxField DataField="PublicHousing"
HeaderText="PublicHousing" SortExpression="PublicHousing" />
<asp:BoundField DataField="Date" HeaderText="Date"
SortExpression="Date" />
<asp:BoundField DataField="Length" HeaderText="Length"
SortExpression="Length" />
<asp:BoundField DataField="EmpLastName"
HeaderText="EmpLastName" SortExpression="EmpLastName" />
<asp:BoundField DataField="EmpfirstName"
HeaderText="EmpfirstName" SortExpression="EmpfirstName" />
</Columns>
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True"
ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource7" runat="server"
ConflictDetection="CompareAllValues"
DataFile="C:\Inetpub\wwwroot\db\VBTEST.mdb"
DeleteCommand="DELETE FROM [Trespass] WHERE [AutoNumber] = ? AND [LastName] =
? AND [Soundex] = ? AND [FirstName] = ? AND [MiddleInitial] = ? AND
[CaseNumber] = ? AND [DOB] = ? AND [Race] = ? AND [Sex] = ? AND [Address] = ?
AND [PublicHousing] = ? AND [Date] = ? AND [Length] = ? AND [EmpLastName] = ?
AND [EmpfirstName] = ?"
InsertCommand="INSERT INTO [Trespass] ([AutoNumber], [LastName],
[Soundex], [FirstName], [MiddleInitial], [CaseNumber], [DOB], [Race], [Sex],
[Address], [PublicHousing], [Date], [Length], [EmpLastName], [EmpfirstName])
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT * FROM [Trespass]"
UpdateCommand="UPDATE [Trespass] SET [LastName] = ?, [Soundex] =
?, [FirstName] = ?, [MiddleInitial] = ?, [CaseNumber] = ?, [DOB] = ?, [Race]
= ?, [Sex] = ?, [Address] = ?, [PublicHousing] = ?, [Date] = ?, [Length] = ?,
[EmpLastName] = ?, [EmpfirstName] = ? WHERE [AutoNumber] = ? AND [LastName] =
? AND [Soundex] = ? AND [FirstName] = ? AND [MiddleInitial] = ? AND
[CaseNumber] = ? AND [DOB] = ? AND [Race] = ? AND [Sex] = ? AND [Address] = ?
AND [PublicHousing] = ? AND [Date] = ? AND [Length] = ? AND [EmpLastName] = ?
AND [EmpfirstName] = ?">
<DeleteParameters>
<asp:Parameter Name="original_AutoNumber" Type="Int32" />
<asp:Parameter Name="original_LastName" Type="String" />
<asp:Parameter Name="original_Soundex" Type="String" />
<asp:Parameter Name="original_FirstName" Type="String" />
<asp:Parameter Name="original_MiddleInitial" Type="String" />
<asp:Parameter Name="original_CaseNumber" Type="Int32" />
<asp:Parameter Name="original_DOB" Type="String" />
<asp:Parameter Name="original_Race" Type="String" />
<asp:Parameter Name="original_Sex" Type="String" />
<asp:Parameter Name="original_Address" Type="String" />
<asp:Parameter Name="original_PublicHousing" Type="Boolean" />
<asp:Parameter Name="original_Date" Type="DateTime" />
<asp:Parameter Name="original_Length" Type="String" />
<asp:Parameter Name="original_EmpLastName" Type="String" />
<asp:Parameter Name="original_EmpfirstName" Type="String" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="LastName" Type="String" />
<asp:Parameter Name="Soundex" Type="String" />
<asp:Parameter Name="FirstName" Type="String" />
<asp:Parameter Name="MiddleInitial" Type="String" />
<asp:Parameter Name="CaseNumber" Type="Int32" />
<asp:Parameter Name="DOB" Type="String" />
<asp:Parameter Name="Race" Type="String" />
<asp:Parameter Name="Sex" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="PublicHousing" Type="Boolean" />
<asp:Parameter Name="Date" Type="DateTime" />
<asp:Parameter Name="Length" Type="String" />
<asp:Parameter Name="EmpLastName" Type="String" />
<asp:Parameter Name="EmpfirstName" Type="String" />
<asp:Parameter Name="original_AutoNumber" Type="Int32" />
<asp:Parameter Name="original_LastName" Type="String" />
<asp:Parameter Name="original_Soundex" Type="String" />
<asp:Parameter Name="original_FirstName" Type="String" />
<asp:Parameter Name="original_MiddleInitial" Type="String" />
<asp:Parameter Name="original_CaseNumber" Type="Int32" />
<asp:Parameter Name="original_DOB" Type="String" />
<asp:Parameter Name="original_Race" Type="String" />
<asp:Parameter Name="original_Sex" Type="String" />
<asp:Parameter Name="original_Address" Type="String" />
<asp:Parameter Name="original_PublicHousing" Type="Boolean" />
<asp:Parameter Name="original_Date" Type="DateTime" />
<asp:Parameter Name="original_Length" Type="String" />
<asp:Parameter Name="original_EmpLastName" Type="String" />
<asp:Parameter Name="original_EmpfirstName" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="AutoNumber" Type="Int32" />
<asp:Parameter Name="LastName" Type="String" />
<asp:Parameter Name="Soundex" Type="String" />
<asp:Parameter Name="FirstName" Type="String" />
<asp:Parameter Name="MiddleInitial" Type="String" />
<asp:Parameter Name="CaseNumber" Type="Int32" />
<asp:Parameter Name="DOB" Type="String" />
<asp:Parameter Name="Race" Type="String" />
<asp:Parameter Name="Sex" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="PublicHousing" Type="Boolean" />
<asp:Parameter Name="Date" Type="DateTime" />
<asp:Parameter Name="Length" Type="String" />
<asp:Parameter Name="EmpLastName" Type="String" />
<asp:Parameter Name="EmpfirstName" Type="String" />
</InsertParameters>
</asp:AccessDataSource>


</div>
</form>
</body>
</html>

Any help with this would be great. Thanks.


.



Relevant Pages

  • RE: Using data from cells in a Query to a MS Access Database
    ... I tried what you had suggested and still could not edit the parameters. ... I then select "MS Access Database" and then browse to the location of my ... I did put in any filters because it won't allow me to enter in the cell ... "Microsoft Query" window and allowed to add criteria. ...
    (microsoft.public.excel.programming)
  • Re: How do I link Access to Project ?
    ... Copy/Paste Link uses the old DDE technology and it's too easy to corrupt ... Project can save its files to an Access database (File, ... With care you can edit ... >I would like to link Microsoft Access database to Microsoft project ...
    (microsoft.public.project)
  • Re: Edit button is greyed when opening an .mdb or xls file
    ... The "Edit" button in Word ... works with Access database created using Word's built-in ... And if one does use these features to create a ... This reply is posted in the Newsgroup; ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Combo box
    ... and click an edit button. ... Is your Access database too slow? ... > a cart they can select how many and what colour. ... > that lists imformation only specific to that row. ...
    (microsoft.public.access.queries)
  • Re: Showing Field Properties of a Database
    ... > I wrote an ASP script with allows me to select an MS Access database ... Microsoft MVP -- ASP/ASP.NET ... Please reply to the newsgroup. ...
    (microsoft.public.inetserver.asp.general)