Solved

Update database using Frontpage

Posted on 2004-04-09
17
3,592 Views
Last Modified: 2013-12-24
I have a table in an MS Access database that I want to update using both visible and hidden fields from a frontpage form.  I seem to be able to create the recordset and retrieve the database record to update without a problem.  But when I try to update the record I get an error stating "Cannot update the database".  I suspect that is happening because frontpage is trying to add a record instead of update the selected record.  I have tried using the database results wizard as well a custom query to make this update.  I have even taken a shot at using ASP to make this update but can't get it to work either.  

This application runs on IIS on a Win 2K server in an intranet environment.  I am using frontpage 2000 to build the site.  

Any suggestions?

-cv
0
Comment
Question by:cv349
17 Comments
 
LVL 2

Expert Comment

by:JakeBushnell
ID: 10798722
Hi cv, you need to make sure you have read and write permissions set on the folder where your database is located.

Using the IIS consol open the properties of the folder where your database is located and make sure read and write access is checked.

You can also do this in FP itself I think. You have to first uncheck "Allow scripts to be run" then click "Apply" and THEN check "Allow upload to this directory".

The easiest way around this though is to remove your existing database and then re-import it using the FP database import wizard which will change all the permissions for you automatically.

Let me know how it goes!
Jake
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10799484
In order to perform an update of a database you need to pass a WHERE statement in your SQL query.

UPDATE Table SET (Field1='::Field1::', Field2='::Field2::') WHERE ID = ::ID::

Create a form to retrieve a record from the database and have the form submit to another ASP page with the UPDATE statement.

You will need to have either a form field with the database ID or submit via a querystring like

Update_Record.asp?ID=<%=varID%>

When I do this I normally have three pages. The first pages displays all records in the database. On this same page I have a hyperlink opening an update page and let it select the record I want to edit.

On the second page is a form containing all the information you desire to edit.

On the third page is the update SQL query using the FP DBRW and normally a redirect statement returning me to the first page.

Let me know what areas you desire more help with.

RCMB
0
 
LVL 12

Accepted Solution

by:
rcmb earned 500 total points
ID: 10799502
I did a little more for you.

Note: the field Information is updated via a hidden field in the form on asp_demo2.asp. Right click on the form and select Form Properties, Advanced to see the hidden field.

Create a database with the following fields:
ID (autonumber), LastName (Text), FirstName (Text), MiddleName (Text) and Information (Text). Name the table DemoTable and import into FRONTPAGE and name the DB connection Demo.

Here is page 1 (asp_demo1.asp):

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ID</title>
</head>

<body>

<table width="100%" border="1">
  <thead>
    <tr>
      <td><b>ID</b></td>
      <td><b>LastName</b></td>
      <td><b>FirstName</b></td>
      <td><b>MiddleName</b></td>
      <td><b>Information</b></td>
    </tr>
  </thead>
  <tbody>
    <!--webbot bot="DatabaseRegionStart" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-columntypes="3,202,202,202,202" s-dataconnection="Demo" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource="DemoTable" s-displaycolumns="ID,LastName,FirstName,MiddleName,Information" s-criteria s-order s-sql="SELECT * FROM DemoTable" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM DemoTable"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=5 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Demo"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=5
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="64469" -->
<% varID = fp_rs("ID") %>
<tr>
      <td>
      <a href="asp_demo2.asp?ID=<%=varID%>">
      <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-column="ID" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;ID&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"ID")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="62813" --></a></td>
      <td>
      <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-column="LastName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;LastName&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"LastName")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="14417" --></td>
      <td>
      <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-column="FirstName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;FirstName&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"FirstName")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="18712" --></td>
      <td>
      <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-column="MiddleName" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;MiddleName&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"MiddleName")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="28065" --></td>
      <td>
      <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-column="Information" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;Information&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"Information")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="31367" --></td>
    </tr>
    <!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>

</body>

</html>

Here is page 2 (asp_demo2.asp):

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_LCID = 1033 %>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Update the information and press submit</title>
</head>

<body>

<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-columntypes="3,202,202,202,202" s-dataconnection="Demo" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="FALSE" i-listformat="7" b-makeform="FALSE" s-recordsource="DemoTable" s-displaycolumns="LastName,FirstName,MiddleName" s-criteria="{ID} EQ {ID} +" s-order s-sql="SELECT * FROM DemoTable WHERE (ID =  ::ID::)" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="ID=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM DemoTable WHERE (ID =  ::ID::)"
fp_sDefault="ID="
fp_sNoRecords="No records returned."
fp_sDataConn="Demo"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="56599" --><form METHOD="POST" action="asp_demo3.asp?ID=<%=varID%>">
  <p>Update the information and press submit.</p>
  <table BORDER="0">
    <tr>
      <td><b>LastName:</b></td>
      <td>
      <input TYPE="TEXT" NAME="LastName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"LastName")%>"></td>
    </tr>
    <tr>
      <td><b>FirstName:</b></td>
      <td>
      <input TYPE="TEXT" NAME="FirstName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"FirstName")%>"></td>
    </tr>
    <tr>
      <td><b>MiddleName:</b></td>
      <td>
      <input TYPE="TEXT" NAME="MiddleName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"MiddleName")%>"></td>
    </tr>
    <tr>
      <td COLSPAN="2"><br>
      <input TYPE="Submit" NAME="fp_submit"><input TYPE="Reset" NAME="fp_reset"></td>
    </tr>
  </table>
  <input type="hidden" name="Information" value="Test of Webpage">
</form>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></body></html>

Here is page 3 (asp_demo3.asp):

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 3</title>
</head>

<body>

<table>
  <tbody>
    <!--webbot bot="DatabaseRegionStart" s-columnnames s-columntypes s-dataconnection="Demo" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="FALSE" b-tableexpand="FALSE" b-tableheader="FALSE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource s-displaycolumns s-criteria s-order s-sql="UPDATE DemoTable SET LastName='::LastName::', FirstName='::FirstName::', MiddleName='::MiddleName::', Information='::Information::' WHERE ID = ::ID::" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="LastName=&amp;FirstName=&amp;MiddleName=&amp;Information=&amp;ID=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="UPDATE DemoTable SET LastName='::LastName::', FirstName='::FirstName::', MiddleName='::MiddleName::', Information='::Information::' WHERE ID = ::ID::"
fp_sDefault="LastName=&FirstName=&MiddleName=&Information=&ID="
fp_sNoRecords="<tr><td colspan=16 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="Demo"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=16
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="49167" --><!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>

</body>

</html>

Hope this helps,

RCMB
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10799509
Made a small mistake on asp_demo2.asp (page 2) - here is the corrected page.

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_LCID = 1033 %>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Update the information and press submit</title>
</head>

<body>

<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,LastName,FirstName,MiddleName,Information" s-columntypes="3,202,202,202,202" s-dataconnection="Demo" b-tableformat="FALSE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="FALSE" i-listformat="7" b-makeform="FALSE" s-recordsource="DemoTable" s-displaycolumns="LastName,FirstName,MiddleName" s-criteria="{ID} EQ {ID} +" s-order s-sql="SELECT * FROM DemoTable WHERE (ID =  ::ID::)" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields="ID=" s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="0" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM DemoTable WHERE (ID =  ::ID::)"
fp_sDefault="ID="
fp_sNoRecords="No records returned."
fp_sDataConn="Demo"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="56599" -->
<%varID = fp_rs("ID") %>
<form METHOD="POST" action="asp_demo3.asp?ID=<%=varID%>">
  <p>Update the information and press submit.</p>
  <table BORDER="0">
    <tr>
      <td><b>LastName:</b></td>
      <td>
      <input TYPE="TEXT" NAME="LastName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"LastName")%>"></td>
    </tr>
    <tr>
      <td><b>FirstName:</b></td>
      <td>
      <input TYPE="TEXT" NAME="FirstName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"FirstName")%>"></td>
    </tr>
    <tr>
      <td><b>MiddleName:</b></td>
      <td>
      <input TYPE="TEXT" NAME="MiddleName" SIZE="40" VALUE="<%=FP_FieldHTML(fp_rs,"MiddleName")%>"></td>
    </tr>
    <tr>
      <td COLSPAN="2"><br>
      <input TYPE="Submit" NAME="fp_submit"><input TYPE="Reset" NAME="fp_reset"></td>
    </tr>
  </table>
  <input type="hidden" name="Information" value="Test of Webpage">
</form>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside tag="BODY" preview="&lt;table border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></body></html>


RCMB
0
 
LVL 19

Expert Comment

by:webwoman
ID: 10802966
I just want to make a note here...

If you learn ASP, and aren't dependent on FP to do everything for you, you would have about 1/5 (or less) code, and it would take about 2 minutes to make changes.
0
 

Author Comment

by:cv349
ID: 10814994
RCMB -

A couple of points.  First, the asp_demo1 page displays all the data from the table, but no links or anything to select certain data for update.  The asp_demo2 and asp_demo3 pages display errors stating that a parameter is missing.  I assume that this is the data that is supposed to be updated from the asp_demo1 page.  

asp_demo2 error:

Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Extra ) in query expression '(ID = )'.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers

One or more form fields were empty. You should provide default values for all form fields that are used in the query.

asp_demo3 error:

Database Results Error
Description: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID ='.
Number: -2147217900 (0x80040E14)
Source: Microsoft OLE DB Provider for ODBC Drivers

One or more form fields were empty. You should provide default values for all form fields that are used in the query.

Did I miss something on the first page?

-cv
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10816313
Make sure you copied my second asp_demo2.asp page. In my first response I made a mistake and sent the corrected page to you.

I just copied the pages to a new server and all worked fine.


You cannot open the asp_demo2 or asp_demo3 directly. These pages must be activated from the first page.

If the link is missing on asp_demo1 then do the following:

Click on <<ID>> in normal view and select the hyperlink tool to create a hyperlink
In the address type asp_demo2.asp
Click on parameters on the right side and select ADD
Hit the drop-down on the top choice and select ID
Click OK twice and the following should appear in the address:
asp_demo2.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>

Save the page and preview in browser.

You can click on the hyperlink to access asp_demo2.asp and make changes as necessary.

If you add this to the bottom of asp_demo3.asp (above the </body> and </html> tags) it will automatically redirect you the asp_demo1.asp page and you will be able to see your changes immediately:

<SCRIPT LANGUAGE="JavaScript">
var version = navigator.appVersion;

      // sets variable = browser version
      if (version.indexOf("MSIE") >= -1)
      // checks to see if using IE
         {
         window.location.href="asp_demo1.asp"
         /* If using IE, it shows this page
         replace ie.htm with page name */
      }else
      window.open("asp_demo1.asp", target="_self")
      /* else open other page
      replace other.html with page name */
     
</SCRIPT>

Have fun and let me know how it goes.

RCMB
0
 

Author Comment

by:cv349
ID: 10817592
OK, now I am getting an 500.100 error that says:

Error Type:
Active Server Pages, ASP 0126 (0x80004005)
The include file '_fpclass/fpdblib.inc' was not found.
/asptest/OriginalPages/asp_demo1.asp, line 23

Any ideas?

And by the way, did you generate the code for the above pages entirely in frontpage or did you modify the pages with your own code?

-cv
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 12

Expert Comment

by:rcmb
ID: 10817668
With one minor exception everything was created in FrontPage.

On asp_demo2.asp I added the line <%varID = fp_rs("ID") %> to assign the ID to a variable.

To correct your problem run the DBRW on each page by double clicking on the yellow bar (this is the start of the database region) in the normal front page view. Accept the defaults in each of the five steps and then resave the files.

The problem is caused by pasting the code into the file and then not reestablishing the _fpclass file links. It should only take a second to perform these tasks.

I originally created the files in the root folder of my server so the links were not correct for you. I see you placed them in a sub-directory and running the dbrw should fix the problem.

RCMB
0
 

Author Comment

by:cv349
ID: 10822138
OK it is working but I want to make sure I can do what I want to do myself.  If I want to use a cookie value or session variable as selection criteria for the record to update where do I enter that criteria and what is the syntax?  

-cv
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10822517
To use a session variable or cookie value you need to create an initial form (like a search form) that submits to asp_demo1.asp and then modify the SQL query in asp_demo1.asp to limit the results to the desired information. Set the initial values of the form fields to the values you desire to obtain from your variables.

Your form will probably need to be saved as an ASP page depending on what you are doing.

Or you can create a hyperlink with the variables in the querystring - something like:

asp_demo1.asp?Name=<%=cookie.value%>&Date=<%=Date%>

Have you SQL look something like:

SELECT * FROM Table WHERE Field1='::Name::' AND Field2=#::Date::# ORDER BY Field1 ASC

Tons of options here so I need more specifics to help more but this should give you the general idea of what is available.

RCMB
0
 

Author Comment

by:cv349
ID: 10835517
My specific application is an intranet witha  database of urls for policy and training documents. When a user logs on his windows logon username is stored as a session variable and the homepage displays a list of waiting documents specific to that user.   Each document has a form with an "Acknowledgement" button at the end that (hopefully) will update the database to indicate that the user has read the document and return the user to the homepage.  The documents that have been acknowledged will no longer appear on the users list of waiting documents.  

This is my answer to having to issue policy and training updates and get written acknowledgements from employees.  Everyone uses the intranet daily and if the homepage were customized to show these waiting documents and allow users to make acknowledgements online we would save a lot of trees.

I already have the database set up as well as the homepage with the personalized list of waiting documents.  All these questions have been towards building the form to acknowledge the document and updatet the database.  Any suggestions that you have are greatly appreciated.
-cv
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10835794
First thing I need to know is are you using IIS and do you have anonymous access turned off?

With this you can capture the user's logon ID and then work from there.

RCMB
0
 

Author Comment

by:cv349
ID: 10853976
Yes I am running IIS and anonymous access is turned off.  I currently capture the logon name from the server variables and strip off the computer name to leave the username for my session variable.  This is done in the global.asa file and seems to work well.

-cv
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10879518
Working with session ids

You can start your home page with something like: (your home page must be an asp page)

<% If Len(Session("UID") = 0 Then %>

Do something here like display the database to tell them what they need to read or redirect them to a page that has their data that needs review and have that page assign the session id and once complete redirect the back to the home page

<% Else %>

<%
'Insert your code to get the users login id
'This assigns the Session("UID") to their login so the next time they visit the home page it just proceeds as normal
Session("UID") = varUserLoginID
%>

Finish your home page

RCMB
0
 
LVL 12

Expert Comment

by:rcmb
ID: 10894168
Just a little nudge to closeout this question.

R/RCMB
0
 

Author Comment

by:cv349
ID: 10912447
Sorry for the delay but my time has been consumed by a little emergency.  We had the big crash and had to rebuild the intranet server.  Thankfully I had a current backup!!  I increased the points because I got more from this question than I had hoped to get.  Thanks.

-cv
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now