newbie trying to use data access web page (Access 2003)

C

Chris

I have a simple name and location database that I plan on using for a
bigger project. I ran into this Data Access Page feature and wanted
to see if I could use it so that the user interface is more friendly
for the people that will be entering in the data. I've created the
webpage, but when I try to add a new record, it gives me an error
saying

"You can't add a new record or delete an existing record because the
recordset for this page is read-only"

How can I make it not read-only? Is this by design?

I am using a Windows XP machine with Office 2003. It is a real simple
DB, I just want to see it work on a small scale before I scale up.

Here's the code to that Data Access Page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:eek: =
"urn:schemas-microsoft-com:eek:ffice:eek:ffice" xmlns:x =
"urn:schemas-microsoft-com:eek:ffice:excel" xmlns:a =
"urn:schemas-microsoft-com:eek:ffice:access" xmlns:dt =
"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"><HEAD><TITLE>Page1</
TITLE><LINK
href="Page1_files/filelist.xml" type=text/xml rel=File-List>
<META content=Access.Application name=ProgId>
<META name=VBSForEventHandlers VALUE="TRUE">
<META http-equiv=Content-Type content="text/html;
charset=windows-1252">
<META content=10.00.3420 name=DesignerVersion>
<META content="HTML 4.0" name=vs_targetSchema>
<OBJECT id=MSODSC tabIndex=-1
classid=CLSID:0002E553-0000-0000-C000-000000000046><PARAM
NAME="XMLData" VALUE="<xml xmlns:a=&quot;urn:schemas-microsoft-
com:eek:ffice:access&quot;>
<a:DataSourceControl>

<a:OWCVersion>10.0.0.6765 </a:OWCVersion>

<a:ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;User
ID=Admin;Data Source=C:\Documents and Settings\e183d1\Desktop
\test.mdb;Mode=Share Deny None;Extended
Properties=&amp;quot;&amp;quot;;Persist Security Info=False;Jet
OLEDB:System database=&amp;quot;&amp;quot;;Jet OLEDB:Registry
Path=&amp;quot;&amp;quot;;Jet OLEDB:Database
Password=&amp;quot;&amp;quot;;Jet OLEDB:Engine Type=0;Jet
OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database
Password=&amp;quot;&amp;quot;;Jet OLEDB:Create System
Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy
Locale on Compact=False;Jet OLEDB:Compact Without Replica
Repair=False;Jet OLEDB:SFP=False</a:ConnectionString>

<a:MaxRecords>10000</a:MaxRecords>
<a:GridX>24</
a:GridX>
<a:GridY>24</a:GridY>
<a:OfflineType>2</
a:OfflineType>
<a:XMLLocation>0</a:XMLLocation>

<a:XMLDataTarget></a:XMLDataTarget>
<a:ConnectionFile></
a:ConnectionFile>
<a:ElementExtension>

<a:ElementID>Text0</a:ElementID>

<a:ChildLabel>Text0_Label</a:ChildLabel>
</
a:ElementExtension>
<a:ElementExtension>

<a:ElementID>Text1</a:ElementID>

<a:ChildLabel>Text1_Label</a:ChildLabel>
</
a:ElementExtension>
<a:ElementExtension>

<a:ElementID>Text4</a:ElementID>

<a:ChildLabel>Text4_Label</a:ChildLabel>
</
a:ElementExtension>
<a:ElementExtension>

<a:ElementID>sampleNavLabel</a:ElementID>

<a:RecordsetLabel>sample |0 of |2;sample |0-|1 of |2</
a:RecordsetLabel>
</a:ElementExtension>

<a:GroupLevel>
<a:RecordSource>sample</
a:RecordSource>
<a:DefaultSort></
a:DefaultSort>
<a:HeaderElementId>Headersample</
a:HeaderElementId>
<a:FooterElementId></
a:FooterElementId>
<a:CaptionElementId></
a:CaptionElementId>

<a:RecordNavigationElementId>Navigationsample</
a:RecordNavigationElementId>
<a:DataPageSize>1</
a:DataPageSize>
<a:GroupFilterControl></
a:GroupFilterControl>
</a:GroupLevel>

<a:Datamodel a:version=&quot;0816&quot;>

<a:SchemaRowsource a:id=&quot;sample&quot;
a:type=&quot;dscTable&quot;>
<a:SchemaField
a:id=&quot;e_date&quot; a:datatype=&quot;7&quot; a:size=&quot;0&quot;/
<a:SchemaField a:id=&quot;e_title&quot;
a:datatype=&quot;130&quot; a:size=&quot;50&quot;/>

<a:SchemaField a:id=&quot;e_owner&quot; a:datatype=&quot;130&quot;
a:size=&quot;50&quot;/>
<a:SchemaField
a:id=&quot;e_location&quot; a:datatype=&quot;130&quot; a:size=&quot;
50&quot;/>
<a:SchemaField a:id=&quot;e_trackid&quot;
a:datatype=&quot;3&quot; a:size=&quot;0&quot; a:iskey=&quot;1&quot;/
</a:SchemaRowsource>
<a:RecordsetDef
a:id=&quot;sample&quot;>
</a:RecordsetDef>
</
a:Datamodel>
</a:DataSourceControl>
</xml>"></
OBJECT>
<META content="MSHTML 6.00.2900.3132" name=GENERATOR>
<STYLE id=MSODAPDEFAULTS type=text/css>.MSTheme-Label {
BORDER-RIGHT: 0px; PADDING-RIGHT: 3px; BORDER-TOP: 0px; PADDING-LEFT:
3px; FONT-SIZE: 8pt; OVERFLOW: visible; BORDER-LEFT: 0px; WIDTH: 1in;
BORDER-BOTTOM: 0px; FONT-FAMILY: Tahoma; HEIGHT: 0.156in; TEXT-ALIGN:
left
}
..MsoTextbox {
PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-SIZE: 8pt; OVERFLOW:
hidden; WIDTH: 1in; FONT-FAMILY: Tahoma; HEIGHT: 0.197in
}
..MsoBoundSpan {
BORDER-RIGHT: 0px; PADDING-RIGHT: 3px; BORDER-TOP: 0px; PADDING-LEFT:
3px; FONT-SIZE: 8pt; OVERFLOW: hidden; BORDER-LEFT: 0px; BORDER-
BOTTOM: 0px; FONT-FAMILY: Tahoma; TEXT-ALIGN: left
}
..MsoHyperlinkDisplayText {
BORDER-RIGHT: 0px; PADDING-RIGHT: 3px; BORDER-TOP: 0px; PADDING-LEFT:
3px; FONT-SIZE: 8pt; OVERFLOW: hidden; BORDER-LEFT: 0px; CURSOR: hand;
BORDER-BOTTOM: 0px; FONT-FAMILY: Tahoma; TEXT-ALIGN: left
}
..Mso2dSection {
LEFT: 0px; BEHAVIOR: url(#DEFAULT#Mso2dSection); OVERFLOW: hidden;
POSITION: relative; TOP: 0px; BACKGROUND-COLOR: transparent
}
..Mso2dSectionBanner {
PADDING-RIGHT: 4px; DISPLAY: none; PADDING-LEFT: 4px; FONT-WEIGHT:
normal; FONT-SIZE: 8pt; LEFT: 0px; BEHAVIOR:
url(#DEFAULT#Mso2dSectionBanner); OVERFLOW: visible; PADDING-TOP: 2px;
FONT-FAMILY: Tahoma; TOP: 0px; HEIGHT: 0.2in; BACKGROUND-COLOR:
buttonface
}
..MsoRectangle {
BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; OVERFLOW:
hidden; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid
}
..MsoTitle {
DISPLAY: none; FONT-WEIGHT: normal; COLOR: inactivecaptiontext
}
..MsoExpandCollapse {
CURSOR: hand
}
..MsoNavContainer {
BORDER-RIGHT: gainsboro 1px solid; BORDER-TOP: gainsboro 1px solid; Z-
INDEX: -1; BORDER-LEFT: gainsboro 1px solid; CURSOR: hand; BORDER-
BOTTOM: gainsboro 1px solid; HEIGHT: 25px; BACKGROUND-COLOR: gainsboro
}
..MsoNavButton {
BORDER-RIGHT: gainsboro 1px solid; BORDER-TOP: gainsboro 1px solid;
BORDER-LEFT: gainsboro 1px solid; CURSOR: auto; BORDER-BOTTOM:
gainsboro 1px solid; BACKGROUND-REPEAT: no-repeat
}
..MsoNavButtonMouseOver {
BORDER-RIGHT: highlight 1px solid; BORDER-TOP: highlight 1px solid;
BORDER-LEFT: highlight 1px solid; BORDER-BOTTOM: highlight 1px solid;
BACKGROUND-COLOR: buttonhighlight
}
..MsoNavToggleButtonMouseOver {
BORDER-RIGHT: buttonshadow 1px solid; BORDER-TOP: buttonshadow 1px
solid; BORDER-LEFT: buttonshadow 1px solid; BORDER-BOTTOM:
buttonshadow 1px solid; BACKGROUND-REPEAT: no-repeat; BACKGROUND-
COLOR: buttonshadow
}
..MsoNavButtonMouseDown {
BORDER-RIGHT: buttonshadow 1px solid; BORDER-TOP: buttonshadow 1px
solid; BORDER-LEFT: buttonshadow 1px solid; CURSOR: hand; BORDER-
BOTTOM: buttonshadow 1px solid; BACKGROUND-COLOR: buttonshadow
}
..MsoNavRecordsetLabel {
BORDER-RIGHT: gainsboro 1px solid; BORDER-TOP: gainsboro 1px solid;
PADDING-LEFT: 0px; FONT-SIZE: 8pt; OVERFLOW: hidden; BORDER-LEFT:
gainsboro 1px solid; WIDTH: 100%; CURSOR: default; PADDING-TOP: 0px;
BORDER-BOTTOM: gainsboro 1px solid; FONT-FAMILY: Tahoma; POSITION:
relative
}
..MsoRecordSelector {
BORDER-RIGHT: buttonshadow 1px solid; BORDER-TOP: buttonshadow 1px
solid; OVERFLOW: hidden; BORDER-LEFT: buttonshadow 1px solid; BORDER-
BOTTOM: buttonshadow 1px solid; HEIGHT: 100%; BACKGROUND-COLOR:
gainsboro
}
..MsoRecordSelectorCurrent {
BACKGROUND-POSITION: 1px 0px; BACKGROUND-IMAGE: url(owc://GIF/
#11240); BACKGROUND-REPEAT: no-repeat
}
..MsoRecordSelectorSelectedImage {
BACKGROUND-POSITION: 1px 0px; BACKGROUND-IMAGE: url(owc://GIF/
#11241); BACKGROUND-REPEAT: no-repeat
}
..MsoRecordSelectorSelected {
BORDER-RIGHT: buttonshadow 1px solid; BORDER-TOP: buttonshadow 1px
solid; LEFT: 0px; OVERFLOW: hidden; BORDER-LEFT: buttonshadow 1px
solid; BORDER-BOTTOM: buttonshadow 1px solid; TOP: 0px; HEIGHT: 100%;
BACKGROUND-COLOR: buttonshadow
}
..MsoRecordSelectorDirtyCurrent {
BACKGROUND-POSITION: -1px 0px; BACKGROUND-IMAGE: url(owc://GIF/
#11242); BACKGROUND-REPEAT: no-repeat
}
..MsoRecordSelectorDirty {
BACKGROUND-POSITION: -1px 0px; BACKGROUND-IMAGE: url(owc://GIF/
#11245); BACKGROUND-REPEAT: no-repeat
}
..MsoRecordSelectorTransparent {
LEFT: 0px; OVERFLOW: hidden; TOP: 0px
}
HR {
COLOR: black
}
SELECT {
FONT-SIZE: 8pt; FONT-FAMILY: Tahoma
}
INPUT {
FONT-SIZE: 8pt; FONT-FAMILY: Tahoma
}
BODY {
FONT-SIZE: 10pt; FONT-FAMILY: Tahoma
}
MARQUEE {
FONT-SIZE: 8pt; FONT-FAMILY: Tahoma
}
LEGEND {
FONT-SIZE: 8pt; FONT-FAMILY: Tahoma
}
BUTTON {
FONT-SIZE: 8pt; FONT-FAMILY: Tahoma
}
TEXTAREA {
FONT-SIZE: 8pt; FONT-FAMILY: Tahoma
}
</STYLE>

<SCRIPT language=Javascript id=MSODSC_Validation>
validateBrowser();

function validateBrowser() {
strVers=navigator.appVersion
strName=navigator.appName
strPlat=navigator.platform
intIndex1=strVers.indexOf("MSIE");
intIndex1=intIndex1+5
intIndex2=strVers.lastIndexOf(";");
intVer=strVers.substring(intIndex1, intIndex2)
intVer=parseInt(intVer)
if (strName=="Microsoft Internet Explorer" && strPlat=="Win32" &&
intVer>="5") {
validateOWC();
}
else {
strMsgGetIE="<TABLE cellSpacing=0 cellPadding=0 width='95%' border=0
height='8'><TR>"
strMsgGetIE+="<TD bgColor='#336699' height=25 width=15>&nbsp;</
TD><TD bgColor='#666666' width=500px><FONT face=Tahoma "
strMsgGetIE+="size=4 color=white><b>&nbsp;Data Access Page
Notification</B></FONT></TD></TR>"
strMsgGetIE+="<TR><TD bgColor='#cccccc' width=15>&nbsp;</TD><TD
bgColor='#cccccc' width=500px><BR>"
strMsgGetIE+="<p><font face='Tahoma' size='2'>"
strMsgGetIE+="This page requires Windows IE 5.0 or higher.</p>"
strMsgGetIE+="<a href='http://www.microsoft.com/isapi/redir.dll?
Prd=Office&Sbp=Access&Pver=10&Ar=DPdesigner&Sba=IEhome&Plcid=1033'><p
align='center'>"
strMsgGetIE+="Click here to install the latest version of Internet
Explorer.</a></font></p><br></TD></TR></TABLE>"
document.write(strMsgGetIE)
}
}

function validateOWC() {
if (MSODSC.object==null) {
strMsgGetOWC="<TABLE width='95%' cellpadding=0 cellspacing=0
border=0 height='8'>"
strMsgGetOWC+="<TR><TD bgColor='#336699' height=25 width=15>&nbsp;</
TD><TD bgColor='#666666' width=500px>"
strMsgGetOWC+="<FONT face=Tahoma color=white size=4><B>&nbsp;&nbsp;"
strMsgGetOWC+="Data Access Page Notification</B></FONT></TD></
TR><TR><TD bgColor='#cccccc' width=15>&nbsp;</TD>"
strMsgGetOWC+="<TD bgColor='#cccccc' width='500px'><BR>"
strMsgGetOWC+="<p><font face='Tahoma' size='2'>This page requires
the Microsoft Office Web Components.</p>"
strMsgGetOWC+="</font><p><font face='Tahoma' size='2'>See the <a
HRef='http://r.office.microsoft.com/r/rlidmsowcpub?
clid=1033&p1=Microsoft Access&HelpLCID=1033'>Microsoft Office Web
site</a> for more information. "
strMsgGetOWC+="</font></p><BR></TD></TR></TABLE>"
document.write(strMsgGetOWC)
}
}

</SCRIPT>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Christopher Hogan</o:Author>
<o:LastAuthor>Christopher Hogan</o:LastAuthor>
<o:Revision>6</o:Revision>
<o:TotalTime>39</o:TotalTime>
<o:Created>2007-08-17T22:03:27Z</o:Created>
<o:LastSaved>2007-08-17T22:45:03Z</o:LastSaved>
<o:Company>Enterprise Rent-A-Car</o:Company>
<o:Version>11.8132</o:Version>
</o:DocumentProperties>
</xml><![endif]--></HEAD>
<BODY style="OVERFLOW: auto" vLink=#800080 link=#0000ff>
<CENTER>
<H1 class="" id=HeadingText>TEST ENTRY PAGE</H1></CENTER>
<P>&nbsp;</P>
<DIV class=Mso2dSectionBanner id=HeadersampleBanner
style="MARGIN-LEFT: 0px; WIDTH: 6.323in" tabIndex=-1><SPAN
id=HeadersampleBannerCaption>Header: sample</SPAN></DIV>
<DIV class=Mso2dSection id=Headersample
style="VISIBILITY: hidden; MARGIN-LEFT: 0px; WIDTH: 6.323in; HEIGHT:
2in"><SPAN
class=MSTheme-Label id=Text0_Label
style="Z-INDEX: 1; LEFT: 0.162in; OVERFLOW: hidden; WIDTH: 0.34in;
POSITION: absolute; TOP: 0.375in; HEIGHT: 0.161in">Date:</
SPAN><TEXTAREA class=MsoTextbox id=Text0 style="Z-INDEX: 2; LEFT:
0.583in; POSITION: absolute; TOP: 0.375in" tabIndex=1
MsoTextAlign="General"></TEXTAREA><SPAN
class=MSTheme-Label id=Text1_Label
style="Z-INDEX: 3; LEFT: 1.836in; OVERFLOW: hidden; WIDTH: 0.274in;
POSITION: absolute; TOP: 0.375in; HEIGHT: 0.161in">Title:</
SPAN><TEXTAREA class=MsoTextbox id=Text1 style="Z-INDEX: 4; LEFT:
2.287in; WIDTH: 1.084in; POSITION: absolute; TOP: 0.375in; HEIGHT:
0.197in" tabIndex=2 cols=13 MsoTextAlign="General"></TEXTAREA><SPAN
class=MSTheme-Label id=Text4_Label
style="Z-INDEX: 5; LEFT: 0.329in; OVERFLOW: hidden; WIDTH: 0.562in;
POSITION: absolute; TOP: 1.125in; HEIGHT: 0.156in">Location:</
SPAN><TEXTAREA class=MsoTextbox id=Text4 style="Z-INDEX: 6; LEFT:
0.958in; POSITION: absolute; TOP: 1.125in" tabIndex=3
MsoTextAlign="General"></TEXTAREA><BUTTON
id=addr
style="Z-INDEX: 7; LEFT: 0.5in; WIDTH: 1.271in; POSITION: absolute;
TOP: 1.625in; HEIGHT: 0.24in"
tabIndex=4 MsoTextAlign="General">Add Record</BUTTON>
<SCRIPT language=javascript event=onclick for=addr>
try { if (MSODSC.CurrentSection == null)
MSODSC.DataPages(0).NewRecord();
else
MSODSC.CurrentSection.DataPage.NewRecord(); }
catch (e)
{ alert (e.description);}
</SCRIPT>
<BUTTON id=delr
style="Z-INDEX: 8; LEFT: 2in; WIDTH: 1.49in; POSITION: absolute; TOP:
1.625in; HEIGHT: 0.24in"
tabIndex=5 MsoTextAlign="General">Delete Record</BUTTON>
<SCRIPT language=javascript event=onclick for=delr>
try { if (MSODSC.DataPages.Count > 0)
if (MSODSC.CurrentSection == null)
MSODSC.DataPages(0).DeleteRecord();
else
MSODSC.CurrentSection.DataPage.DeleteRecord(); }
catch (e)
{ alert (e.description);}
</SCRIPT>
</DIV>
<DIV class=Mso2dSectionBanner id=NavigationsampleBanner
style="MARGIN-LEFT: 0px; WIDTH: 6.323in" tabIndex=-1><SPAN
id=NavigationsampleBannerCaption>Navigation: sample</SPAN></DIV>
<DIV class=Mso2dSection id=Navigationsample
style="VISIBILITY: hidden; MARGIN-LEFT: 0px; WIDTH: 6.323in; HEIGHT:
0.333in; BACKGROUND-COLOR: gainsboro">
<TABLE class=MsoNavContainer id=sampleNavigation
style="LEFT: 4px; WIDTH: 568px; POSITION: absolute; TOP: 4px; HEIGHT:
18px"
cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavFirst id=sampleNavFirst tabIndex=6 height=20
src="owc://GIF/#11200" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavPrevious id=sampleNavPrevious tabIndex=7 height=20
src="owc://GIF/#11202" width=20></TD>
<TD style="VERTICAL-ALIGN: middle; WIDTH: 100%; TEXT-ALIGN:
center"
noWrap><SPAN class=MsoNavRecordsetLabel id=sampleNavLabel
style="VISIBILITY: hidden" tabIndex=8>sample |0 of |2</SPAN></
TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavNext id=sampleNavNext tabIndex=9 height=20
src="owc://GIF/#11204" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavLast id=sampleNavLast tabIndex=10 height=20
src="owc://GIF/#11206" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavAddNew id=sampleNavNew tabIndex=11 height=20
src="owc://GIF/#11208" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavDelete id=sampleNavDelete tabIndex=12 height=20
src="owc://GIF/#11210" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavSave id=sampleNavSave tabIndex=13 height=20
src="owc://GIF/#11214" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavUndo id=sampleNavUndo tabIndex=14 height=20
src="owc://GIF/#11212" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavSortAsc id=sampleNavSortAscending tabIndex=15
height=20
src="owc://GIF/#11216" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavSortDesc id=sampleNavSortDescending tabIndex=16
height=20
src="owc://GIF/#11218" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavFilter id=sampleNavFilterBySelection tabIndex=17
height=20
src="owc://GIF/#11220" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavToggleFilter id=sampleNavFilterToggle tabIndex=18
height=20
src="owc://GIF/#11222" width=20></TD>
<TD class=MsoNavButton style="WIDTH: 20px; HEIGHT: 20px"><IMG
class=MsoNavHelp id=sampleNavHelp tabIndex=19 height=20
src="owc://GIF/#11224" width=20></TD></TR></TBODY></TABLE></DIV>
<P>&nbsp;</P></BODY></HTML>


Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top