rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Access Database Question - 1/21/2005 11:07:40
quote:
I'm not too concerned about coding .asp, its the turn time that concerns me. Once you've converted 1 DRW over to arrays, the rest go very quickly. I've said many times before that you can support 10 times the number of users on an Access DB just by 'tossing' the DRW and coding arrays with ASP. Here's an example of a DRW turned into array-based. Here's the DWR: <table border="1">
<thead>
<tr>
<td><b>UserID</b></td>
<td><b>UserName</b></td>
</tr>
</thead>
<tbody>
<!--webbot bot="DatabaseRegionStart" startspan
s-columnnames="UserID,UserName,Password,aps_uid,x_lastname,x_firstname,x_email,EmailUse,AddDatetime,UpdateDatetime,AccessLevel,Admin,ActiveAccount,AccountExpires,RemoteAddress,LoginCount,x_company,x_address,x_city,x_state,x_zip,x_phone,x_fax,u_id,isManager,dept,dateOfHire,PTODays,shiftNumber,lunchCode,deptB,directPhone,keyCode,PTOCarryover"
s-columntypes="3,202,202,202,202,202,202,11,135,135,202,11,11,135,202,3,202,202,202,202,202,202,202,3,202,202,135,3,3,3,202,202,129,4"
s-dataconnection="CAIntNet" b-tableformat="TRUE" b-menuformat="FALSE"
s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="FALSE"
b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE"
i-ListFormat="0" b-makeform="TRUE" s-recordsource="tblUsers"
s-displaycolumns="UserID,UserName" s-criteria s-order
s-sql="SELECT * FROM tblUsers" b-procedure="FALSE" clientside
SuggestedExt="asp" s-DefaultFields s-NoRecordsFound="No records returned."
i-MaxRecords="256" i-GroupSize="0" BOTID="0"
u-dblib="fpweb:///_fpclass/fpdblib.inc"
u-dbrgn1="fpweb:///_fpclass/fpdbrgn1.inc"
u-dbrgn2="fpweb:///_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 region will not work unless the page has a file extension of ".asp".</font></td></tr>" --><!--#include file="fpweb:///_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM tblUsers"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=2 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="CAIntNet"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="fpweb:///_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" I-CheckSum="59889" endspan -->
<tr>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="UserID,UserName,Password,aps_uid,x_lastname,x_firstname,x_email,EmailUse,AddDatetime,UpdateDatetime,AccessLevel,Admin,ActiveAccount,AccountExpires,RemoteAddress,LoginCount,x_company,x_address,x_city,x_state,x_zip,x_phone,x_fax,u_id,isManager,dept,dateOfHire,PTODays,shiftNumber,lunchCode,deptB,directPhone,keyCode,PTOCarryover"
s-column="UserID" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>UserID<font size="-1">>></font>"
preview="<font size="-1"><<</font>UserID<font size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"UserID")%><!--webbot
bot="DatabaseResultColumn" I-CheckSum="16626" endspan -->
</td>
<td><!--webbot bot="DatabaseResultColumn" startspan
s-columnnames="UserID,UserName,Password,aps_uid,x_lastname,x_firstname,x_email,EmailUse,AddDatetime,UpdateDatetime,AccessLevel,Admin,ActiveAccount,AccountExpires,RemoteAddress,LoginCount,x_company,x_address,x_city,x_state,x_zip,x_phone,x_fax,u_id,isManager,dept,dateOfHire,PTODays,shiftNumber,lunchCode,deptB,directPhone,keyCode,PTOCarryover"
s-column="UserName" b-tableformat="TRUE" b-hasHTML="FALSE" clientside
local_preview="<font size="-1"><<</font>UserName<font size="-1">>></font>"
preview="<font size="-1"><<</font>UserName<font size="-1">>></font>" --><%=FP_FieldVal(fp_rs,"UserName")%><!--webbot
bot="DatabaseResultColumn" I-CheckSum="17279" endspan -->
</td>
</tr>
<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="TRUE"
b-menuformat="FALSE" u-dbrgn2="fpweb:///_fpclass/fpdbrgn2.inc"
i-groupsize="0" 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>"
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>" --><!--#include file="fpweb:///_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" I-CheckSum="23298" endspan -->
</tbody>
</table>
and here's the array-based one: <table border="1">
<thead>
<tr>
<td><b>UserID</b></td>
<td><b>UserName</b></td>
</tr>
</thead>
<tbody>
<%
myDSN = "DSN=xxx;uid=xxx;pwd=xxxx;database=xxxxt"
mySQL = "SELECT * FROM tblUsers"
set conntemp=server.createobject("adodb.connection")
conntemp.open myDSN
set rstemp=conntemp.execute(mySQL)
IF rstemp.eof THEN
response.write ("<tr><td>ERROR 127:NO USERLISTQ1 " & userSQL & "</td></tr>")
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
ELSE
alldata=rstemp.getrows
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
FOR i = 0 to ubound(alldata,2)
%>
<tr>
<td><%=alldata(0,i)%>
</td>
<td><%=alldata(1,i)%>
</td>
</tr>
<%
NEXT
END IF%>
</tbody>
</table>
Much smaller and faster than any DRW. SQL Server support can be costly and (IMO anyways) converting to mySQL will require a greater learning curve. And you'll still be using the DRW  . Again, once you learn arrays, you'll never want to go back. You get rid of issues like trying to nest DRW's and stuff like that. Yes, people are correct when they say that Access is limited, but efficient coding for the DB can vastly increase the performance. And look at the code. If you have no issues coding ASP, then you should be able to recognize much of what I've posted. I hope it helps (and convert you back over from the Dark Side... ) EDIT: I removed my SQL Server info. OOPS!
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|