Frontpage Sites using Databases

G

Guest

I am trying to connect my Frontpage site to an Access Database, so that i can
import data to a specific web page based upon a result being returned from my
site. Help says i need ASP & Sharepoint enabled within my Page Option
Authoring tab, which it is. But when i try to find a data source, it is not
highlighted as an option within my Task Pane. Also i am now being told that i
should create my site in Sharepoint Services. Could somebody possibly give me
some guidance as to how to approach this issue.
 
S

Stefan B Rusynko

You need to be working is a Windows server based web (http://...), not a disc based web (C:\...)
That is done either
- locally in a PC server w/ the FP SE (like thru IIS under Windows XP Pro) in .asp pages (not .htm pages)
- or online in a hosted site that supports Access and ASP

Disregard the references to Sharepoint - they are common error messages
- the messages are referring to the FP Server Extensions if Not running Windows SharePoint Services (which also supports DB)

--




|I am trying to connect my Frontpage site to an Access Database, so that i can
| import data to a specific web page based upon a result being returned from my
| site. Help says i need ASP & Sharepoint enabled within my Page Option
| Authoring tab, which it is. But when i try to find a data source, it is not
| highlighted as an option within my Task Pane. Also i am now being told that i
| should create my site in Sharepoint Services. Could somebody possibly give me
| some guidance as to how to approach this issue.
|
|
 
G

Guest

Hi there,

Many thanks for your reply. Unfortunately i am not completely up to speed
with the whole web based developement structure, so forgive me if i come
across a little ignorant, even though i am a developer within the Print &
Mail Industry.

So are you basically saying that there is no way that i can continue working
on my locally based FrontPage version, with per say an Access Database
located in the root directory of my web resources, and then upload to my host
server (host co. = xcalibre)??
 
G

Guest

Hi there,

Thanks for that! If i have already set up the majority of my site using .htm
pages in Frontpage, how easy is it to convert them all to .asp? Is it just a
case of Save As... etc??? I am pretty sure that my host server supports the
ASP / Access functions. Basically i am trying to connect to an Access
Database so that i can import data to a specific web page when a particular
item number is clicked on (which will be my primary key identifier within the
DB). When i go to 'Find a Data Source', within FPage, it is not highlighted
as a viable option. I have also just installed IIS onto my XP Pro System. Do
you have any ideas as to where to go from here to be able to get the Data
Source option available???

Cheers
 
M

MikeR

To convert, just rename the page, changing the .htm or .html to .asp. However, unless you
write the ASP code, you have no asp functionality. You can use the FP database wizard for
fairly simple tasks, or you can write your own code if you need more
control/flexibility/clarity. I don't work on my local machine, and I don't use the wizards.
If you want to tinker with writing your own asp, here is a connection string, an SQL
query, and the code to display some fields. There is no provision here for a select based
on a key, as this is just a little demo of ASP, if you haven't seen it before. Lines
beginning with a ' are comments. The response.write statements are for debugging.
Beware line wrap on long lines here.
MikeR
<%
Option explicit
Dim conxtemp, sql, PWRS

set conxtemp=server.createobject("adodb.connection")
conxtemp.Mode = 3

'Change the path and database name to match yours.
' Below should beon one line
conxtemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("/fpdb/mydatabase.mdb")
'Change the table and field names to match your database
sql="select * from Items;"
Set PWRS = CreateObject("ADODB.Recordset")
PWRS.Open sql, conxtemp, 3, 3
'response.write "recs= " & pwrs.recordcount & "<br>"
If pwrs.recordcount < 1 then
set PWRS=nothing
conxtemp.close
set conxtemp=nothing
response.redirect "my_error_page.html"
End If

%>

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
<title>MyPage</title>
</head>

<body>
<center>
<table width = "100%" border="1" cellpadding="4" cellspacing="0" style="border-collapse:
collapse" bordercolor="#111111">
<tr>
<%Do while Not PWRS.EOF%>
<td align="left"><%=PWRS("Prod_ID")%></td>
<td align="left"><%=PWRSRS("Description")%></td>
<td align="left"><%=MRS("On_Hand")%></td>
</tr>
<%mrs.movenext
Loop %>
</table>
<%
set PWRS=nothing
conxtemp.close
set conxtemp=nothing
%>
</body>
</html>
 
A

Andrew Murray

If there's any asp content i.e. you connect a form to a database, FP will
prompt you to save those pages as *.asp

If there's no asp code in the pages, there's no point saving as anything
besides *.html or *.htm
 
T

Thomas A. Rowe

If you are going to run ASP/VBScript in a site, and you don't want to loose the ASP sessions, then
all pages need to have .asp extensions even if there is not ASP/VBScript on the page.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WebMaster Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
G

Guest

Hi there,

Many thanks for your conclusive reply, very informative. What i currently
have for example are 2 .asp pages, one will have an auto thumbnail displayed,
and with which upon i have created a hyperlink that will take me to the
second page. Within that hyperlink i created a Parameter which i hope will be
passed to the second page, and then placed within my sql query to display all
the relevant info for that parameter when it finds its matching primary key
record within the db.

Here is the code i currently have for the 1st Page with the thumbnail and
hyperlink:

<a href="ProdInfo.asp?ProdQuery=MC0001">
<img border="2" src="images/Moorcroft/MC0001_small.jpg"
xthumbnail-orig-image="images/Moorcroft/MC0001.jpg" width="68" height="154"
onclick="FP_openNewWindow('500', '600', false, false, false, false, false,
false, 'ProductInformation', /*href*/'ProdInfo.htm')"></a></td>
<td width="117" bgcolor="#66FFFF" height="162">



And here is the code that was created for the db results page, based upon
which parameter is passed to it. Just not completely sure that its dealing
with the 'ProdQuery' param properly.


<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 Moorcroft where devcode ='::prodQuery::'"
fp_sDefault="ProdQuery="
fp_sNoRecords="No records returned."
fp_sDataConn="ItemMatrix"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&Dev Code=202&UKC Code=202&Vase
Type=202&Designer=202&Pattern=202&Full
Description=202&Date=2&Price=6&Height=202&"
fp_iDisplayCols=7
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="60637" --><p><b>UKC
Code:</b>&nbsp;<!--webbot bot="DatabaseResultColumn" s-columnnames="Dev
Code,UKC Code,Vase Type,Designer,Pattern,Full Description,Date,Price,Height"
s-column="UKC Code" b-tableformat="FALSE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>UKC Code<font size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"UKC Code")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="11885" --></p>
<p><b>Vase Type:</b> <!--webbot bot="DatabaseResultColumn"
s-columnnames="Dev Code,UKC Code,Vase Type,Designer,Pattern,Full
Description,Date,Price,Height" s-column="Vase Type" b-tableformat="FALSE"
b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>Vase Type<font size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Vase Type")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="18877" --></p>
<p><b>Designer:</b> <!--webbot bot="DatabaseResultColumn" s-columnnames="Dev
Code,UKC Code,Vase Type,Designer,Pattern,Full Description,Date,Price,Height"
s-column="Designer" b-tableformat="FALSE" b-hashtml="FALSE"
b-makelink="FALSE" clientside b-MenuFormat preview="<font
size="-1">&lt;&lt;</font>Designer<font size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Designer")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="14887" --></p>
<p><b>Full Description:</b> <!--webbot bot="DatabaseResultColumn"
s-columnnames="Dev Code,UKC Code,Vase Type,Designer,Pattern,Full
Description,Date,Price,Height" s-column="Full Description"
b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE" clientside
b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Full Description<font
size="-1">&gt;&gt;</font>" startspan --><%=FP_FieldVal(fp_rs,"Full
Description")%><!--webbot bot="DatabaseResultColumn" endspan
i-checksum="44331" --></p>
<p><b>Date:</b> <!--webbot bot="DatabaseResultColumn" s-columnnames="Dev
Code,UKC Code,Vase Type,Designer,Pattern,Full Description,Date,Price,Height"
s-column="Date" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Date<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Date")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="3267" --></p>
<p><b>Price:</b> <!--webbot bot="DatabaseResultColumn" s-columnnames="Dev
Code,UKC Code,Vase Type,Designer,Pattern,Full Description,Date,Price,Height"
s-column="Price" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Price<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Price")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="9640" --></p>
<p><b>Height:</b> <!--webbot bot="DatabaseResultColumn" s-columnnames="Dev
Code,UKC Code,Vase Type,Designer,Pattern,Full Description,Date,Price,Height"
s-column="Height" b-tableformat="FALSE" b-hashtml="FALSE" b-makelink="FALSE"
clientside b-MenuFormat preview="<font size="-1">&lt;&lt;</font>Height<font
size="-1">&gt;&gt;</font>" startspan
--><%=FP_FieldVal(fp_rs,"Height")%><!--webbot bot="DatabaseResultColumn"
endspan i-checksum="14492" --></p>
<hr>
<!--webbot bot="DatabaseRegionEnd" b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"
clientside tag="BODY" preview="<table border=0 width="100%"><tr><td
bgcolor="#FFFF00"><font color="#000000">This is the end of a Database Results
region.</font></td></tr></table>" startspan --><!--#include
file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --> </div>

</body>

</html>
 
M

MikeR

As I said, I don't use the wizards, so I'm not sure what's going on. Actually, you didn't
say what the problem is. Are you getting an error message? Is the data not what you expected?
If you want to check if the value of ProdQuery is coming in correctly, then
<%
response.write "ProdQuery= " & request.querystring("ProdQuery") & "<p>"
fp_sQry="SELECT * FROM Moorcroft where devcode ='::prodQuery::'"
response.write "SQL= " & fp_sQry
response.end

I don't know if '::prodQuery::' gets populated, but the above should tell you -- if the
response.writes will stay. FP may take them out when you save the page.
MikeR
 
G

Guest

Hi there,

Thanks for the below. Yes you are right. Frontpage did overwrite the coding
i tried to put in below. Do you know why it does that, just out of
interest??? I have carried this posting onto a new one called 'SQL Query
Problems'.

Cheers
 
M

MikeR

The people who wrote FP did it to prevent people from shooting themselves in the foot by
messing with the webbot code. I understand the rationale, but it has a pretty big downside
when things do go awry, as you have discovered. My .02 worth of opinion is to learn to use
a scripting language, and stay away from the bots. Good luck. I'll be following the new
thread to see how it plays out.

MikeR
 

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