Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you create a DB edit screen in Frontpage?

Status
Not open for further replies.

Flapman

Technical User
Jul 6, 2001
18
US
Hi,

How can I create a Page that does more than display record results? I want one that can edit a record I see on the screen.
 
You can do it with a vbscript or access pages. FP won't do it for you.
 
Yes you can edit fields in front page it is a bit drown out but possible. Here goes the explaination You will need 3 pages to complete this. A page to select the rewcord to edit, a page to do the editting, and a page to submit the edit on.

First you have to select the record you want to edit. I am going to use the lastName field in the employees table of the Northwind Database.

Connect and display the LastName field in a table in the usual manner.

Second you have to make a Hyperlink to the edit form on another page and you have to pass along the parameter of the Name you are editting and of the unique identifyer for the record you want to edit.

Do this by right clicking on the <<LastName>> field in the Frontpage generated table. Next select HYPERLINK
in the address section type in the name of your edit page....Mine is LastNameEdit.asp
now you have to pass the parameters. Click the PARAMETERS button on the bottom of the Hyperlink Window. Now CLick ADD

In the NAME window select the column Last Name this should fill in the Value field with <%=FP_FieldURL(fp_rs,&quot;LastName&quot;)%>
Click OK then Click ADD Again

In the NAME window select the Primary Key column EmployeeID this should fill in the Value field with <%=FP_FieldURL(fp_rs,&quot;EmployeeID&quot;)%>

now click OK and OK and OK....this is the edit selection page.

Now open a new page and this will be the edit page. On this page Create a form By selecting INSERT ->FORM-> ONE LINE TEXT BOX

This will set a form on your page with a text box that we will do the editing in.

Double Click the Text box and
In the name area enter &quot;LastName&quot;,
in the initial Value area type in <%=request(&quot;LastName&quot;)%> the &quot;<%&quot; Tells frontpage you are writing in VB and the &quot;=&quot; means &quot;Write&quot;. next the request(&quot;LastName&quot;) means whatever data was passed to this page with the parameter of LastName and Finally the &quot;%>&quot; Means that you are done typing in VB.

Now we need to set the form up to go to the Final page.
Right Click on the form and Click FORM PROPERTIES. Check the Radio Button For &quot;Send to other&quot; next hit the OPTIONS button.

In the actions area type the Name of your edit submit page...mine is LastNameEditSubmit.asp

Click OK

We need to also pass that employeeID Parameter From the Last Page we will do that with a Hidden Input field

Click ADVANCED

In the ADVANCED FORM PROPERTIES box click ADD

In the name Filed type in the name of your Parameter....employeeID and in the value box type in
<%=request(&quot;employeeID&quot;)%> See above for an explaination of this code.

Now Click OK till you are out of these windows...

Finally the last page....

this page has to be made by altering a bit of the SQL Query in the insert Database Results Wizard. it is not too bad though.

First INSERT->DATABASE RESULTS to open the wizard and Connect to the NORTHWIND Database in Page One then hit NEXT

In Page 2 of 5 Click the radio button for &quot;Custom Query&quot;
in the Custom Query window there may be something like select* from........erase that and type in

update employees
set LastName='::LastName::'
where employeeID='::employeeID'

(the ':: and ::' tell frontpage these are parameters and that they are text.....if you have nemeric data leave off the tick marks)

now click verify query and hope for a &quot;bing&quot; along with a succesful message. if it gliched you prolly have a typo.

OK out of these back to page 2 of 5 and hit NEXT

on Page 3 of 5 hit MORE OPTIONS

in the Message to display taxt field type in &quot;Data Changed&quot;

Hit o.k. and go to Page 4 of 5

On Page 4 of 5 Uncheck all of the Check Boxes and leave the drop down on TABLE- one record per row

Click Next to get to page 5 of 5

on page 5 of 5 Click the radio button for &quot;Display all records together&quot;
and turn off the &quot;Add search Form&quot; button.

Click FINISH ...save all your pages and hope like hell

launch the first page select a name to edit.....make changes and submit thwem to the 3rd page

Hope this helps

Tal McMahon




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top