|
 |
access_asp thread: ASP+Access+FrontPage98=Problem
Message #1 by "syinaz" <naz_2401@h...> on Thu, 6 Jun 2002 05:59:56
|
|
Hi
I'm a beginner in asp surrounding and I really appreciate help from all of
you in solving my problem especially from those who have experience in
dealing with FrontPage 98.
I've built an Access 97 database which consist of a CUSTOMER TABLE and a
CUSTOMER QUERY. I'm trying to build a web page using asp tech. in
Microsoft FrontPage 98 to interact with the database (to view,edit etc).
Below are some problems I'm facing:
------------------------------------
1)I tried to use Databse Region Wizard (in FrontPage 98), I can't see my
database even I try to view it in IE.
2)Every time I try to view it in my web browser,there comes out a window
asking me whether to download and save it on a disk or open the asp
document from its current page. I've already tried both and my asp
document will appear in FrontPage surrounding (when what I actually want
is it to be viewed in my web browser).
I hope someone can tell me what might be the reason to these problems.
Thank you in advance and may God bless u..
syinaz
Message #2 by "Ken Schaefer" <ken@a...> on Thu, 6 Jun 2002 15:57:38 +1000
|
|
To answer your second question:
You need to access the ASP page like so:
http://<yourservername>/yourpagename.asp
You can't access it by double-clicking on it in Explorer. This is because
the ASP code needs to be processed, and it is the webserver that does this,
so:
http://localhost/MyFirstASPPage.asp
would be the way you would do it.
I can't answer the first question because you have provided no code, you
haven't listed the steps that you used to produce the code, nor have you
described any error message. If I asked you: "my car doesn't work, what's
wrong?" you wouldn't be able to answer that either.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "syinaz" <naz_2401@h...>
Subject: [access_asp] ASP+Access+FrontPage98=Problem
: Hi
:
: I'm a beginner in asp surrounding and I really appreciate help from all of
: you in solving my problem especially from those who have experience in
: dealing with FrontPage 98.
:
: I've built an Access 97 database which consist of a CUSTOMER TABLE and a
: CUSTOMER QUERY. I'm trying to build a web page using asp tech. in
: Microsoft FrontPage 98 to interact with the database (to view,edit etc).
:
: Below are some problems I'm facing:
: ------------------------------------
: 1)I tried to use Databse Region Wizard (in FrontPage 98), I can't see my
: database even I try to view it in IE.
: 2)Every time I try to view it in my web browser,there comes out a window
: asking me whether to download and save it on a disk or open the asp
: document from its current page. I've already tried both and my asp
: document will appear in FrontPage surrounding (when what I actually want
: is it to be viewed in my web browser).
:
: I hope someone can tell me what might be the reason to these problems.
: Thank you in advance and may God bless u..
:
: syinaz
Message #3 by "syinaz" <naz_2401@h...> on Mon, 10 Jun 2002 05:31:42
|
|
Thank you, Ken for providing the answer to one of my question.
Actually I've tried to access the ASP page the way you've suggested but to
no avail. I still can't see my ASP page.
Do you think it has to do with the PWS because when I clicked at the PWS
icon on the right hand side icon bar, the Personal Web Manager window
didn't appear. Instead, what appeared was PWS Properties. FIY, I'm using
Windows 95, and I installed PWS at the same time I installed FrontPage 98.
During the installation, a few files were skipped from being installed
even I've inserted the Windows 95 installer the setup program requested
because the files were not there.
As for the steps taken to view my database, I'm sorry I didn't provide it
last time. Well, these are the steps:
--------------------------------------
1)In the FrontPage Editor, I click Insert>Database Region Wizard on the
standard toolbar.
2)I've set ODBC DSN (System DSN) as "company" to point to my database so I
type "company" (without the double quote) ODBC DSN field.
3)In the SQL Query field, below is the code I use:
Select * From CUSTOMERTABLE
4)Lastly, in the "Enter query field names" field, I add all the field
names in my CUSTOMERTABLE (Access 97).
FIY, there were no error msg.
Below is the code generated by FrontPage 98:(I just copy&paste them here)
-------------------------------------------------------------------------
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>View All Record</title>
<meta name="Microsoft Theme" content="expeditn 011, default">
<meta name="Microsoft Border" content="tl, default">
</head>
<body>
<table width="100%" border="1">
<tr>
<td><b>CustomerName</b></td>
<td><b>Address1</b></td>
<td><b>Address2</b></td>
<td><b>Address3</b></td>
<td><b>Postcode</b></td>
<td><b>State</b></td>
<td><b>GeneralPhoneNo</b></td>
<td><b>GeneralFax</b></td>
<td><b>Website</b></td>
<td><b>TrainingCentre</b></td>
<td><b>Chairman</b></td>
<td><b>ContactName1</b></td>
<td><b>Abbre1</b></td>
<td><b>Designation1</b></td>
<td><b>ContactPhoneNo1</b></td>
<td><b>ContactFaxNo1</b></td>
<td><b>E-mailAddress1</b></td>
</tr>
<!--webbot bot="DatabaseRegionStart" startspan
s-
columnnames="CustomerName,Address1,Address2,Address3,Postcode,State,General
PhoneNo,GeneralFax,Website,TrainingCentre,Chairman,ContactName1,Abbre1,Desi
gnation1,ContactPhoneNo1,ContactFaxNo1,E-
mailAddress1,ContactName2,Abbre2,Designation2,ContactPhoneNo2,ContactFaxNo2
,E-mailAddress2,SegmentCode,NatureOfBusiness"
s-connstring="DSN=customer" s-password b-tableformat="TRUE"
s-sql="Select * From CUSTOMERTABLE"
local_preview="<tr><td colspan=50 bgcolor="#FFFF00"
align="center" width="100%"><font
color="#000000"> Database Regions do not preview unless this
page is fetched from a Web server using a web browser. The following
table will display one row for each query result row when the page is
fetched from a Web server.</td></tr>"
preview clientside s-DefaultFields s-NoRecordsFound="No Records
Returned" i-MaxRecords
i-ScriptTimeout tag="BODY" --><%
' Substitute in form parameters into the query string
fp_sQry = "Select * From CUSTOMERTABLE"
fp_sDefault = ""
fp_sNoRecords = "No Records Returned"
fp_iMaxRecords = 0
fp_iTimeout = 0
fp_iCurrent = 1
fp_fError = False
fp_bBlankField = False
If fp_iTimeout <> 0 Then Server.ScriptTimeout = fp_iTimeout
Do While (Not fp_fError) And (InStr(fp_iCurrent, fp_sQry, "%%") <> 0)
' found a opening quote, find the close quote
fp_iStart = InStr(fp_iCurrent, fp_sQry, "%%")
fp_iEnd = InStr(fp_iStart + 2, fp_sQry, "%%")
If fp_iEnd = 0 Then
fp_fError = True
Response.Write "<B>Database Region Error: mismatched
parameter delimiters</B>"
Else
fp_sField = Mid(fp_sQry, fp_iStart + 2, fp_iEnd -
fp_iStart - 2)
If Mid(fp_sField,1,1) = "%" Then
fp_sWildcard = "%"
fp_sField = Mid(fp_sField, 2)
Else
fp_sWildCard = ""
End If
fp_sValue = Request.Form(fp_sField)
' if the named form field doesn't exist, make a note of it
If (len(fp_sValue) = 0) Then
fp_iCurrentField = 1
fp_bFoundField = False
Do While (InStr(fp_iCurrentField,fp_sDefault,fp_sField)
<> 0) _
And Not fp_bFoundField
fp_iCurrentField = InStr
(fp_iCurrentField,fp_sDefault, fp_sField)
fp_iStartField = InStr(fp_iCurrentField,
fp_sDefault, "=")
If fp_iStartField = fp_iCurrentField + len
(fp_sField) Then
fp_iEndField = InStr(fp_iCurrentField,
fp_sDefault, "&")
If (fp_iEndField = 0) Then fp_iEndField =
len(fp_sDefault) + 1
fp_sValue = Mid(fp_sDefault,
fp_iStartField+1, fp_iEndField-1)
fp_bFoundField = True
Else
fp_iCurrentField = fp_iCurrentField + len
(fp_sField) - 1
End If
Loop
End If
' this next finds the named form field value, and substitutes in
' doubled single-quotes for all single quotes in the literal value
' so that SQL doesn't get confused by seeing unpaired single-quotes
If (Mid(fp_sQry, fp_iStart - 1, 1) = """") Then
fp_sValue = Replace(fp_sValue, """", """""")
ElseIf (Mid(fp_sQry, fp_iStart - 1, 1) = "'") Then
fp_sValue = Replace(fp_sValue, "'", "''")
ElseIf Not IsNumeric(fp_sValue) Then
fp_sValue = ""
End If
If (len(fp_sValue) = 0) Then fp_bBlankField = True
fp_sQry = Left(fp_sQry, fp_iStart - 1) + fp_sWildCard +
fp_sValue + _
Right(fp_sQry, Len(fp_sQry) - fp_iEnd - 1)
' Fixup the new current position to be after the substituted value
fp_iCurrent = fp_iStart + Len(fp_sValue) + Len
(fp_sWildCard)
End If
Loop
If Not fp_fError Then
' Use the connection string directly as entered from the wizard
On Error Resume Next
set fp_rs = CreateObject("ADODB.Recordset")
If fp_iMaxRecords <> 0 Then fp_rs.MaxRecords = fp_iMaxRecords
fp_rs.Open fp_sQry, "DSN=customer"
If Err.Description <> "" Then
Response.Write "<B>Database Error: " + Err.Description
+ "</B>"
if fp_bBlankField Then
Response.Write " One or more form fields were
empty."
End If
Else
' Check for the no-record case
If fp_rs.EOF And fp_rs.BOF Then
Response.Write fp_sNoRecords
Else
' Start a while loop to fetch each record in the result set
Do Until fp_rs.EOF
%>
<!--webbot bot="DatabaseRegionStart" i-checksum="48102"
endspan -->
<tr>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-
columnnames="CustomerName,Address1,Address2,Address3,Postcode,State,General
PhoneNo,GeneralFax,Website,TrainingCentre,Chairman,ContactName1,Abbre1,Desi
gnation1,ContactPhoneNo1,ContactFaxNo1,E-
mailAddress1,ContactName2,Abbre2,Designation2,ContactPhoneNo2,ContactFaxNo2
,E-mailAddress2,SegmentCode,NatureOfBusiness"
s-column="CustomerName" b-tableformat="TRUE" clientside
local_preview="Database: CustomerName" preview="Database:
CustomerName" --><%
If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr
(fp_rs("CustomerName"))
%>
'HERE THE ABOVE CODE REPEATED FOR EVERY OTHER FIELD IN CUSTOMERTABLE.
'I DIDN'T PROVIDE THE AS IT WOULD BE QUITE LONG. BUT IF YOU STILL WANT TO
'HAVE A LOOK AT IT, IN CASE TO CHECK IF SOMETHING WRONG THERE,
'JUST LET ME KNOW, OK..
<!--webbot
bot="DatabaseResultColumn" i-checksum="57065" endspan --> </td>
</tr>
<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
local_preview preview
clientside tag="BODY" --><%
' Close the loop iterating records
fp_rs.MoveNext
Loop
End If
fp_rs.Close
' Close the If condition checking for a connection error
End If
' Close the If condition checking for a parse error when replacing form
field params
End If
set fp_rs = Nothing
%>
<!--webbot bot="DatabaseRegionEnd" i-checksum="55813" endspan
-->
</table>
</body>
</html>
------------------------------------------------------------------------
TQ for your attention, guidance and time spent to help me out..
------------------------------------------------------------------------
> To answer your second question:
http://localhost/MyFirstASPPage.asp
would be the way you would do it.
I can't answer the first question because you have provided no code, you
haven't listed the steps that you used to produce the code, nor have you
described any error message.
Cheers
Ken
Message #4 by "Ken Schaefer" <ken@a...> on Tue, 11 Jun 2002 12:09:34 +1000
|
|
One thing to consider - Frontpage98 comes with two webservers: the Frontpage
Web Server and the Personal Web Server. Make sure that you have the correct
one installed! (you need PWS), not the Frontpage webserver:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q144190
You could try creating a page like this (in notepad), then save it into your
wwwroot folder, just to see if ASP is working:
<%
Response.Write("Hello World")
%>
save it as testpage1.asp and request it by going to:
http://localhost/testpage1.asp
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "syinaz" <naz_2401@h...>
Subject: [access_asp] Re: ASP+Access+FrontPage98=Problem
: Thank you, Ken for providing the answer to one of my question.
:
: Actually I've tried to access the ASP page the way you've suggested but to
: no avail. I still can't see my ASP page.
:
: Do you think it has to do with the PWS because when I clicked at the PWS
: icon on the right hand side icon bar, the Personal Web Manager window
: didn't appear. Instead, what appeared was PWS Properties. FIY, I'm using
: Windows 95, and I installed PWS at the same time I installed FrontPage 98.
: During the installation, a few files were skipped from being installed
: even I've inserted the Windows 95 installer the setup program requested
: because the files were not there.
:
: As for the steps taken to view my database, I'm sorry I didn't provide it
: last time. Well, these are the steps:
: --------------------------------------
: 1)In the FrontPage Editor, I click Insert>Database Region Wizard on the
: standard toolbar.
: 2)I've set ODBC DSN (System DSN) as "company" to point to my database so I
: type "company" (without the double quote) ODBC DSN field.
: 3)In the SQL Query field, below is the code I use:
:
: Select * From CUSTOMERTABLE
:
: 4)Lastly, in the "Enter query field names" field, I add all the field
: names in my CUSTOMERTABLE (Access 97).
:
: FIY, there were no error msg.
:
: Below is the code generated by FrontPage 98:(I just copy&paste them here)
: -------------------------------------------------------------------------
:
: <html>
:
: <head>
: <meta name="GENERATOR" content="Microsoft FrontPage 3.0">
: <title>View All Record</title>
: <meta name="Microsoft Theme" content="expeditn 011, default">
: <meta name="Microsoft Border" content="tl, default">
: </head>
:
: <body>
: <table width="100%" border="1">
: <tr>
: <td><b>CustomerName</b></td>
: <td><b>Address1</b></td>
: <td><b>Address2</b></td>
: <td><b>Address3</b></td>
: <td><b>Postcode</b></td>
: <td><b>State</b></td>
: <td><b>GeneralPhoneNo</b></td>
: <td><b>GeneralFax</b></td>
: <td><b>Website</b></td>
: <td><b>TrainingCentre</b></td>
: <td><b>Chairman</b></td>
: <td><b>ContactName1</b></td>
: <td><b>Abbre1</b></td>
: <td><b>Designation1</b></td>
: <td><b>ContactPhoneNo1</b></td>
: <td><b>ContactFaxNo1</b></td>
: <td><b>E-mailAddress1</b></td>
: </tr>
: <!--webbot bot="DatabaseRegionStart" startspan
: s-
:
columnnames="CustomerName,Address1,Address2,Address3,Postcode,State,General
:
PhoneNo,GeneralFax,Website,TrainingCentre,Chairman,ContactName1,Abbre1,Desi
: gnation1,ContactPhoneNo1,ContactFaxNo1,E-
:
mailAddress1,ContactName2,Abbre2,Designation2,ContactPhoneNo2,ContactFaxNo2
: ,E-mailAddress2,SegmentCode,NatureOfBusiness"
: s-connstring="DSN=customer" s-password b-tableformat="TRUE"
: s-sql="Select * From CUSTOMERTABLE"
: local_preview="<tr><td colspan=50 bgcolor="#FFFF00"
: align="center" width="100%"><font
: color="#000000"> Database Regions do not preview unless this
: page is fetched from a Web server using a web browser. The following
: table will display one row for each query result row when the page is
: fetched from a Web server.</td></tr>"
: preview clientside s-DefaultFields s-NoRecordsFound="No Records
: Returned" i-MaxRecords
: i-ScriptTimeout tag="BODY" --><%
: ' Substitute in form parameters into the query string
: fp_sQry = "Select * From CUSTOMERTABLE"
: fp_sDefault = ""
: fp_sNoRecords = "No Records Returned"
: fp_iMaxRecords = 0
: fp_iTimeout = 0
: fp_iCurrent = 1
: fp_fError = False
: fp_bBlankField = False
: If fp_iTimeout <> 0 Then Server.ScriptTimeout = fp_iTimeout
: Do While (Not fp_fError) And (InStr(fp_iCurrent, fp_sQry, "%%") <> 0)
: ' found a opening quote, find the close quote
: fp_iStart = InStr(fp_iCurrent, fp_sQry, "%%")
: fp_iEnd = InStr(fp_iStart + 2, fp_sQry, "%%")
: If fp_iEnd = 0 Then
: fp_fError = True
: Response.Write "<B>Database Region Error: mismatched
: parameter delimiters</B>"
: Else
: fp_sField = Mid(fp_sQry, fp_iStart + 2, fp_iEnd -
: fp_iStart - 2)
: If Mid(fp_sField,1,1) = "%" Then
: fp_sWildcard = "%"
: fp_sField = Mid(fp_sField, 2)
: Else
: fp_sWildCard = ""
: End If
: fp_sValue = Request.Form(fp_sField)
:
: ' if the named form field doesn't exist, make a note of it
: If (len(fp_sValue) = 0) Then
: fp_iCurrentField = 1
: fp_bFoundField = False
: Do While (InStr(fp_iCurrentField,fp_sDefault,fp_sField)
: <> 0) _
: And Not fp_bFoundField
: fp_iCurrentField = InStr
: (fp_iCurrentField,fp_sDefault, fp_sField)
: fp_iStartField = InStr(fp_iCurrentField,
: fp_sDefault, "=")
: If fp_iStartField = fp_iCurrentField + len
: (fp_sField) Then
: fp_iEndField = InStr(fp_iCurrentField,
: fp_sDefault, "&")
: If (fp_iEndField = 0) Then fp_iEndField
: len(fp_sDefault) + 1
: fp_sValue = Mid(fp_sDefault,
: fp_iStartField+1, fp_iEndField-1)
: fp_bFoundField = True
: Else
: fp_iCurrentField = fp_iCurrentField + len
: (fp_sField) - 1
: End If
: Loop
: End If
:
: ' this next finds the named form field value, and substitutes in
: ' doubled single-quotes for all single quotes in the literal value
: ' so that SQL doesn't get confused by seeing unpaired single-quotes
: If (Mid(fp_sQry, fp_iStart - 1, 1) = """") Then
: fp_sValue = Replace(fp_sValue, """", """""")
: ElseIf (Mid(fp_sQry, fp_iStart - 1, 1) = "'") Then
: fp_sValue = Replace(fp_sValue, "'", "''")
: ElseIf Not IsNumeric(fp_sValue) Then
: fp_sValue = ""
: End If
:
: If (len(fp_sValue) = 0) Then fp_bBlankField = True
:
: fp_sQry = Left(fp_sQry, fp_iStart - 1) + fp_sWildCard +
: fp_sValue + _
: Right(fp_sQry, Len(fp_sQry) - fp_iEnd - 1)
:
: ' Fixup the new current position to be after the substituted value
: fp_iCurrent = fp_iStart + Len(fp_sValue) + Len
: (fp_sWildCard)
: End If
: Loop
:
: If Not fp_fError Then
: ' Use the connection string directly as entered from the wizard
: On Error Resume Next
: set fp_rs = CreateObject("ADODB.Recordset")
: If fp_iMaxRecords <> 0 Then fp_rs.MaxRecords = fp_iMaxRecords
: fp_rs.Open fp_sQry, "DSN=customer"
: If Err.Description <> "" Then
: Response.Write "<B>Database Error: " + Err.Description
: + "</B>"
: if fp_bBlankField Then
: Response.Write " One or more form fields were
: empty."
: End If
: Else
: ' Check for the no-record case
: If fp_rs.EOF And fp_rs.BOF Then
: Response.Write fp_sNoRecords
: Else
: ' Start a while loop to fetch each record in the result set
: Do Until fp_rs.EOF
: %>
: <!--webbot bot="DatabaseRegionStart" i-checksum="48102"
: endspan -->
:
: <tr>
: <td><!--webbot bot="DatabaseResultColumn" startspan
: s-
:
columnnames="CustomerName,Address1,Address2,Address3,Postcode,State,General
:
PhoneNo,GeneralFax,Website,TrainingCentre,Chairman,ContactName1,Abbre1,Desi
: gnation1,ContactPhoneNo1,ContactFaxNo1,E-
:
mailAddress1,ContactName2,Abbre2,Designation2,ContactPhoneNo2,ContactFaxNo2
: ,E-mailAddress2,SegmentCode,NatureOfBusiness"
: s-column="CustomerName" b-tableformat="TRUE" clientside
: local_preview="Database: CustomerName" preview="Database:
: CustomerName" --><%
: If Not IsEmpty(fp_rs) And Not (fp_rs Is Nothing) Then Response.Write CStr
: (fp_rs("CustomerName"))
: %>
:
: 'HERE THE ABOVE CODE REPEATED FOR EVERY OTHER FIELD IN CUSTOMERTABLE.
: 'I DIDN'T PROVIDE THE AS IT WOULD BE QUITE LONG. BUT IF YOU STILL WANT TO
: 'HAVE A LOOK AT IT, IN CASE TO CHECK IF SOMETHING WRONG THERE,
: 'JUST LET ME KNOW, OK..
:
: <!--webbot
: bot="DatabaseResultColumn" i-checksum="57065" endspan --> </td>
: </tr>
: <!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
: local_preview preview
: clientside tag="BODY" --><%
: ' Close the loop iterating records
: fp_rs.MoveNext
: Loop
: End If
: fp_rs.Close
: ' Close the If condition checking for a connection error
: End If
: ' Close the If condition checking for a parse error when replacing form
: field params
: End If
: set fp_rs = Nothing
: %>
: <!--webbot bot="DatabaseRegionEnd" i-checksum="55813" endspan
: -->
:
: </table>
: </body>
: </html>
: ------------------------------------------------------------------------
: TQ for your attention, guidance and time spent to help me out..
: ------------------------------------------------------------------------
:
: > To answer your second question:
: http://localhost/MyFirstASPPage.asp
:
: would be the way you would do it.
:
: I can't answer the first question because you have provided no code, you
: haven't listed the steps that you used to produce the code, nor have you
: described any error message.
:
: Cheers
: Ken
:
Message #5 by "syinaz" <naz_2401@h...> on Mon, 17 Jun 2002 06:40:07
|
|
TQ very much Ken for your help!
Now I understand+know my mistake. I depended on the PWS I installed with
the Frontpage98. Thank U very much..
Just dunno what 2 say other than thanks..
BUT I haven't tried installing the real PWS yet. Something happened 2 my
pc. Anyway, thanks again..
> One thing to consider - Frontpage98 comes with two webservers: the
Frontpage
Web Server and the Personal Web Server. Make sure that you have the correct
one installed! (you need PWS), not the Frontpage webserver:
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q144190
|
|
 |