Submit Page:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Home Page</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<form method="POST" action="result.asp" onSubmit="">
<p>Keyword: <input type="text" name="organisation" size="20"><input
type="submit" value="Submit" name="B1"><input type="reset" value="Reset"
name="B2"></p>
</form>
</body>
</html>
Query Page (.asp)
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
<table width="100%" border="1">
<thead>
<tr>
<td><b>NUM</b></td>
<td><b>DST</b></td>
<td><b>STR</b></td>
<td><b>DDL</b></td>
<td><b>DLO</b></td>
<td><b>TWN</b></td>
<td><b>PCD</b></td>
<td><b>ORG</b></td>
<td><b>CTA</b></td>
<td><b>CTP</b></td>
<td><b>CTT</b></td>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-columntypes="200,200,200,200,200,200,200,200,200,200,200"
s-dataconnection="Database2" b-tableformat="TRUE" b-menuformat="FALSE"
s-menuchoice="NUM" s-menuvalue="NUM" b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-ListFormat="0" b-makeform="FALSE" s-recordsource
s-displaycolumns="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT" s-criteria
s-order
s-sql="SELECT * FROM PAF_7t_VIew_by_sachin where<br>(ORG LIKE
'%::Organisation::%') <br>OR (NUM LIKE '%::Organisation::%') <br>OR (DST
LIKE '%::Organisation::%') <br>OR (STR LIKE '%::Organisation::%') <br>OR (DLO
LIKE '%::Organisation::%') <br>OR (TWN LIKE '%::Organisation::%') "
b-procedure="FALSE" clientside SuggestedExt="asp"
s-DefaultFields="Organisation=&Organisation=&Organisation=&Organisation=&Organisation=&Organisation="
s-NoRecordsFound="No records returned." i-MaxRecords="0" i-GroupSize="50"
BOTID="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc"
u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY"
local_preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left"
width="100%"><font color="#000000">Database Results regions will not preview
unless this page is fetched from a Web server with a web browser. The
following table row will repeat once for every record returned by the
query.</font></td></tr>"
preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left"
width="100%"><font color="#000000">This is the start of a Database Results
region. The page must be fetched from a web server with a web browser to
display correctly; the current web is stored on your local disk or
network.</font></td></tr>"
b-WasTableFormat="TRUE" --><!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM PAF_7t_VIew_by_sachin where (ORG LIKE
'%::Organisation::%') OR (NUM LIKE '%::Organisation::%') OR (DST LIKE
'%::Organisation::%') OR (STR LIKE '%::Organisation::%') OR (DLO LIKE
'%::Organisation::%') OR (TWN LIKE '%::Organisation::%') "
fp_sDefault="Organisation=&Organisation=&Organisation=&Organisation=&Organisation=&Organisation="
fp_sNoRecords="<tr><td colspan=11 align=left width=""100%"">No records
returned.</td></tr>"
fp_sDataConn="Database2"
fp_iMaxRecords=0
fp_iCommandType=1
fp_iPageSize=50
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice="NUM"
fp_sMenuValue="NUM"
fp_iDisplayCols=11
fp_fCustomQuery=True
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" i-CheckSum="18401" endspan -->
<tr>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="NUM" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>NUM<font
size="-1">>></font>"
preview="<font size="-1"><<</font>NUM<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"NUM")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="610" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="DST" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>DST<font
size="-1">>></font>"
preview="<font size="-1"><<</font>DST<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"DST")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="65257" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="STR" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>STR<font
size="-1">>></font>"
preview="<font size="-1"><<</font>STR<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"STR")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="807" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="DDL" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>DDL<font
size="-1">>></font>"
preview="<font size="-1"><<</font>DDL<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"DDL")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="63329" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="DLO" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>DLO<font
size="-1">>></font>"
preview="<font size="-1"><<</font>DLO<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"DLO")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="64356" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="TWN" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>TWN<font
size="-1">>></font>"
preview="<font size="-1"><<</font>TWN<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"TWN")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="1251" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="PCD" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>PCD<font
size="-1">>></font>"
preview="<font size="-1"><<</font>PCD<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"PCD")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="63961" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="ORG" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>ORG<font
size="-1">>></font>"
preview="<font size="-1"><<</font>ORG<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"ORG")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="284" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="CTA" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>CTA<font
size="-1">>></font>"
preview="<font size="-1"><<</font>CTA<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"CTA")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="65302" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="CTP" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>CTP<font
size="-1">>></font>"
preview="<font size="-1"><<</font>CTP<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"CTP")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="65317" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="NUM,DST,STR,DDL,DLO,TWN,PCD,ORG,CTA,CTP,CTT"
s-column="CTT" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>CTT<font
size="-1">>></font>"
preview="<font size="-1"><<</font>CTT<font
size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"CTT")%><!--webbot
bot="DatabaseResultColumn" i-CheckSum="65321" endspan -->
</td>
</tr>
<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="50"
clientside tag="TBODY"
local_preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left"
width="100%"><font color="#000000">This is the end of a Database Results
region.</font></td></tr><TR><TD ALIGN=LEFT VALIGN=MIDDLE
COLSPAN=64> said:
| "> [1/50]</NOBR></FORM></td></tr>"
preview="<tr><td colspan=64 bgcolor="#FFFF00" align="left"
width="100%"><font color="#000000">This is the end of a Database Results
region.</font></td></tr><TR><TD ALIGN=LEFT VALIGN=MIDDLE
COLSPAN=64><NOBR><INPUT TYPE=Button VALUE=" |< "><INPUT TYPE=Button VALUE="
< "><INPUT TYPE=Button VALUE=" > "><INPUT TYPE=Button VALUE=" >| ">
[1/50]</NOBR><BR></td></tr>" --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" i-CheckSum="62730" endspan -->
</tbody>
</table>
</body>
</html>
Global.asa file:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
'==FrontPage Generated - startspan==
Dim FrontPage_UrlVars(2)
'--Project Data Connection
Application("Database1_ConnectionString") = "DSN=ST2;DRIVER={SQL
Server};UID=user1;PWD=letmein"
Application("Database1_ConnectionTimeout") = 15
Application("Database1_CommandTimeout") = 30
Application("Database1_CursorLocation") = 3
Application("Database1_RuntimeUserName") = "user1"
Application("Database1_RuntimePassword") = "letmein"
'--Project Data Connection
Application("Database2_ConnectionString") = "DSN=ST;DRIVER={SQL
Server};UID=user1;PWD=letmein"
Application("Database2_ConnectionTimeout") = 15
Application("Database2_CommandTimeout") = 30
Application("Database2_CursorLocation") = 3
Application("Database2_RuntimeUserName") = "user1"
Application("Database2_RuntimePassword") = "letmein"
'--
Application("FrontPage_UrlVars") = FrontPage_UrlVars
'==FrontPage Generated - endspan==
End Sub
Sub Session_OnStart
FrontPage_StartSession '==FrontPage Generated==
End Sub
Sub FrontPage_StartSession
On Error Resume Next
if Len(Application("FrontPage_VRoot")) > 0 then Exit Sub
' discover the VRoot for the current page;
' walk back up VPath until we find global.asa
Vroot = Request.ServerVariables("PATH_INFO")
strG1 = "global.asa"
strG2 = "Global.asa"
iCount = 0
do while Len(Vroot) > 1
idx = InStrRev(Vroot, "/")
if idx > 0 then
Vroot = Left(Vroot,idx)
else
' error; assume root web
Vroot = "/"
end if
if FrontPage_FileExists(Server.MapPath(Vroot & strG1)) then exit do
if FrontPage_FileExists(Server.MapPath(Vroot & strG2)) then exit do
if Right(Vroot,1) = "/" then Vroot = Left(Vroot,Len(Vroot)-1)
iCount = iCount + 1
if iCount > 100 then
' error; assume root web
Vroot = "/"
exit do
end if
loop
' map all URL= attributes in _ConnectionString variables
Application.Lock
if Len(Application("FrontPage_VRoot")) = 0 then
Application("FrontPage_VRoot") = Vroot
UrlVarArray = Application("FrontPage_UrlVars")
for i = 0 to UBound(UrlVarArray)
if Len(UrlVarArray(i)) > 0 then FrontPage_MapUrl(UrlVarArray(i))
next
end if
Application.Unlock
End Sub
Sub FrontPage_MapUrl(AppVarName)
' convert URL attribute in conn string to absolute file location
strVal = Application(AppVarName)
strKey = "URL="
idxStart = InStr(strVal, strKey)
If idxStart = 0 Then Exit Sub
strBefore = Left(strVal, idxStart - 1)
idxStart = idxStart + Len(strKey)
idxEnd = InStr(idxStart, strVal, ";")
If idxEnd = 0 Then
strAfter = ""
strURL = Mid(strVal, idxStart)
Else
strAfter = ";" & Mid(strVal, idxEnd + 1)
strURL = Mid(strVal, idxStart, idxEnd - idxStart)
End If
strOut = strBefore & Server.MapPath(Application("FrontPage_VRoot") &
strURL) & strAfter
Application(AppVarName) = strOut
End Sub
Function FrontPage_FileExists(fspath)
On Error Resume Next
FrontPage_FileExists = False
set fs = CreateObject("Scripting.FileSystemObject")
Err.Clear
set istream = fs.OpenTextFile(fspath)
if Err.Number = 0 then
FrontPage_FileExists = True
istream.Close
end if
set istream = Nothing
set fs = Nothing
End Function
</SCRIPT>
Thomas A. Rowe said:
You need to show me you current pages:
1. Submit Page
2. Query/Display Page
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
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.
==============================================
Skc said:
Can you give me a sample "hand coded" page to look up a parameterised search
if I have a form on the previous page passing a parameter called
'organisation' please.
Thanks.
:
Only request the specific fields that you actually need, instead of all fields (*)
If using the FP generated ASP code, don't, instead learn to hand code.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
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.
==============================================
I am using FP2000 and connecting to a SQL2000 database/table on our LAN.
THis table is pretty hefty, it has 7.5m records.
I am connecting to the machine via ODBC, but the performance when doing a
keyword search using the QRY:
SELECT * FROM xxx WHERE
(abc LIKE '%::zzz::%')
OR (xyz LIKE '%::zzz::%')
is appauling. In fact I keep getting timeout messages similar to:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC SQL
Server Driver]Timeout expired
How can I look up records in a large database with quickness with ASP?
THe table is indexed and is quickly retrievable by using Crystal Reports via
ODBC.
skc