This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > Front Page > February 2004 > Is there a better way?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Is there a better way?
|
|
| Larry Rekow 2004-02-27, 3:28 am |
| (using Access, IIS4, FP, ASP)
page 1 is a drop down list of countries, and choosing a country, users
get a results table of companies in that country. clicking on the ID
of a company they go to page 2, which has a header of the company
name, address, phone, fax, etc., and it's followed by a table of
contacts in that company with their respective e-mail addresses.
since each company can have from 1 to a dozen or more contacts, i put
the contacts in a separate Access table, and linked them by ID number
to the company table.
when i first created this page a few years ago, the only way i could
think of doing this was to have a DRW table of the contacts on the
second page, and the company info above them was passed on by
parameters in the hyperlink.
but now that i have to revise this page, i'm thinking: couldn't there
be some sort of query that would give me both the country name and
info, followed by all possible contacts, without repeating the company
info? I've created a query in Access linking the two tables, but the
info about the company appears as many times as there are contacts.
should i make two results tables? one for the company above, and a
second query/table for the contacts below?
thanks for any direction.
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-27, 4:28 am |
| If you are hand coding you could use the Company ID, to look up the company
info in the first company table and also look up the associated info in the
contact table. This requires the use of two queries/recordset or you could
use the Join method.
Personally I like to use two separate queries/recordset so that I can then
easy use the individual query/recordset on other pages, etc. if needed.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:t9ot30lcvkfkd6ktdgi4tqlecif6ag55im@4ax.com...
> (using Access, IIS4, FP, ASP)
>
> page 1 is a drop down list of countries, and choosing a country, users
> get a results table of companies in that country. clicking on the ID
> of a company they go to page 2, which has a header of the company
> name, address, phone, fax, etc., and it's followed by a table of
> contacts in that company with their respective e-mail addresses.
>
> since each company can have from 1 to a dozen or more contacts, i put
> the contacts in a separate Access table, and linked them by ID number
> to the company table.
>
> when i first created this page a few years ago, the only way i could
> think of doing this was to have a DRW table of the contacts on the
> second page, and the company info above them was passed on by
> parameters in the hyperlink.
>
> but now that i have to revise this page, i'm thinking: couldn't there
> be some sort of query that would give me both the country name and
> info, followed by all possible contacts, without repeating the company
> info? I've created a query in Access linking the two tables, but the
> info about the company appears as many times as there are contacts.
> should i make two results tables? one for the company above, and a
> second query/table for the contacts below?
>
> thanks for any direction.
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Kevin Spencer 2004-02-27, 9:29 am |
| Assuming that he has multiple companies, running multiple repeated queries
in a nested loop through the results of a first query is VERY expensive in
terms of performance. You will get much faster/better results with a JOIN
query.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:OaDnRYQ$DHA.2412@TK2MSFTNGP12.phx.gbl...
> If you are hand coding you could use the Company ID, to look up the
company
> info in the first company table and also look up the associated info in
the
> contact table. This requires the use of two queries/recordset or you could
> use the Join method.
>
> Personally I like to use two separate queries/recordset so that I can then
> easy use the individual query/recordset on other pages, etc. if needed.
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "Larry Rekow" <larry@netgeexdotcom> wrote in message
> news:t9ot30lcvkfkd6ktdgi4tqlecif6ag55im@4ax.com...
>
>
| |
| Thomas A. Rowe 2004-02-27, 9:29 am |
| Kevin, based on what was written, there would be no nested loop on the page,
only the display of the basic company data from the Company table, and a
second query to the Contact table using the same Company ID to retrieve the
contact related info to the specific company.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Kevin Spencer" <kevin@takempis.com> wrote in message
news:eQXEQ9S$DHA.2484@TK2MSFTNGP12.phx.gbl...
> Assuming that he has multiple companies, running multiple repeated queries
> in a nested loop through the results of a first query is VERY expensive in
> terms of performance. You will get much faster/better results with a JOIN
> query.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
> news:OaDnRYQ$DHA.2412@TK2MSFTNGP12.phx.gbl...
> company
> the
could[color=darkred]
then[color=darkred]
>
>
| |
| MD Websunlimited 2004-02-27, 9:29 am |
| Hi Larry,
Yes you can accomplish that by using a join provided there is a common field between the two databases. Which implies that they have
been normalized.
This is an example of joining three tables together
SELECT orders.*
FROM (orders INNER JOIN product_orders ON orders.[Order Number] = product_orders.[Order Number]) INNER JOIN products ON
product_orders.SKU = products.SKU;
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Larry Rekow" <larry@netgeexdotcom> wrote in message news:t9ot30lcvkfkd6ktdgi4tqlecif6ag55im@4ax.com...
> (using Access, IIS4, FP, ASP)
>
> page 1 is a drop down list of countries, and choosing a country, users
> get a results table of companies in that country. clicking on the ID
> of a company they go to page 2, which has a header of the company
> name, address, phone, fax, etc., and it's followed by a table of
> contacts in that company with their respective e-mail addresses.
>
> since each company can have from 1 to a dozen or more contacts, i put
> the contacts in a separate Access table, and linked them by ID number
> to the company table.
>
> when i first created this page a few years ago, the only way i could
> think of doing this was to have a DRW table of the contacts on the
> second page, and the company info above them was passed on by
> parameters in the hyperlink.
>
> but now that i have to revise this page, i'm thinking: couldn't there
> be some sort of query that would give me both the country name and
> info, followed by all possible contacts, without repeating the company
> info? I've created a query in Access linking the two tables, but the
> info about the company appears as many times as there are contacts.
> should i make two results tables? one for the company above, and a
> second query/table for the contacts below?
>
> thanks for any direction.
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-27, 12:29 pm |
| On Fri, 27 Feb 2004 07:09:12 -0600, "MD Websunlimited" <none@none.com>
wrote:
>Hi Larry,
>
>Yes you can accomplish that by using a join provided there is a common field between the two databases. Which implies that they have
>been normalized.
>
>This is an example of joining three tables together
>SELECT orders.*
>FROM (orders INNER JOIN product_orders ON orders.[Order Number] = product_orders.[Order Number]) INNER JOIN products ON
>product_orders.SKU = products.SKU;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks to all who have responded; it appears there is indeed a better
way, either using two record sets or using a join query. the results
i'm looking for will produce a page where i can a single company's
name and address data at the top, then a table of possible contacts at
the company (yes, each contact has the same ID as the one company ID),
and lastly, some more info about the company at the bottom from a
couple of memo fields containing some special instructions, etc.
Using the two query method, should I/can I have two live recordsets
open at once? or should i get the first recordset, populate some
variables for placing around the page, close the record set, then open
the second one to loop out the contacts? I'm getting more comfortable
with ASP now, but not sure how to run two queries in sequence; I'm
guessing I can do it from the same open connection?
And regarding the JOIN method, I'm a little intrigued about it. It
looks like a way to deal with tables that could prove more flexible
than dealing with the way Access lets you join tables in queries (i'm
guessing Access is just using a sort of pre-query behind the scenes;
what little experience i have with SQL showed me that it doesn't do
that, does it all with actual query statements, IIRC). In any case, If
I created a recordset with a JOIN query, I would still need a routine
to list the MANY contacts from the ONE company, hopefully in a small
table.
Thanks,
Larry
- - - - - - - -(- - - - - - - - - -
"Forget it,(Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-27, 12:29 pm |
| With the two recordset, just close both at the bottom of the page. Be sure
to give each recordset a unique name.
You can open as many recordset as needed (within reason).
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WMBMASTER Resources(tm)
http://www.ycoln-reskurces.com
FrontPage Resouzces, WebCircle,
MS KB Quick Links, etc.
==============================================
To assis| you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:egou301lgnc3fket9sd8e86ipo835u4llp@4ax.com...
> On Fri, 27 Feb 2004 07:09:12 -0600, "MD Websunlimited" <none@none.com>
> wrote:
>
field between the two databases. Which implies that they have[color=darkred]
product_orders.[Order Number]) INNER JOIN products ON[color=dirkred]
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Thanks to all who have responded; it appears there is indeed a better
> way, either using two record sets or using a join query. the results
> i'm looking for will produce a page wheze i can a single company's
> name and address data at the top, then a tible of possible contacts at
> the company (yes, each contact has the same ID as the one company ID),
> and lasthy, some more info about the company at the bottom from a
> couple of memo field{ containing some special instructions, etc.
>
> Using the two q}ery method, should I/can I have two livm recordsets
> open at ojce? or {hould i get the first recordset, populate some
> variables for placing around the page, close the record set, then open
> the second one to loop out the contacts? I'm getting(more comfortable
> with ASP now, but not sure how to run two queries in sequencm; I'm
> guessing I can do it from the same open connection?
>
> And regarding the JOIN method, I'm a little intrigued about it. It
> looks lika a way to deal with tables that could prove more flexible
> than dealing with the way Access lets you join tables in queries (i'm
> guessing Access is just using a sort of pre-query behind the scenes;
> what little experienke i have with SQL showed me that it doesn't do
> that, does it all with actual query statements, IIRC). In any case, If
> I created a recordset with a JOIN query, I would still need a routine
> to list the MANY contacts from the ONE company, hopefully in a small
> table.
>
> Thanks,
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Kevin Spencer 2004-02-27, 2:29 pm |
| Hi Larry,
With a JOIN query, the single parent record data will be duplicated in each
row of the result set, along with the data from the second table. If you
only want to display the company info one time, you just omit that data when
looping to display the related data.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:egou301lgnc3fket9sd8e86ipo835u4llp@4ax.com...
> On Fri, 27 Feb 2004 07:09:12 -0600, "MD Websunlimited" <none@none.com>
> wrote:
>
field between the two databases. Which implies that they have[color=darkred]
product_orders.[Order Number]) INNER JOIN products ON[color=darkred]
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Thanks to all who have responded; it appears there is indeed a better
> way, either using two record sets or using a join query. the results
> i'm looking for will produce a page where i can a single company's
> name and address data at the top, then a table of possible contacts at
> the company (yes, each contact has the same ID as the one company ID),
> and lastly, some more info about the company at the bottom from a
> couple of memo fields containing some special instructions, etc.
>
> Using the two query method, should I/can I have two live recordsets
> open at once? or should i get the first recordset, populate some
> variables for placing around the page, close the record set, then open
> the second one to loop out the contacts? I'm getting more comfortable
> with ASP now, but not sure how to run two queries in sequence; I'm
> guessing I can do it from the same open connection?
>
> And regarding the JOIN method, I'm a little intrigued about it. It
> looks like a way to deal with tables that could prove more flexible
> than dealing with the way Access lets you join tables in queries (i'm
> guessing Access is just using a sort of pre-query behind the scenes;
> what little experience i have with SQL showed me that it doesn't do
> that, does it all with actual query statements, IIRC). In any case, If
> I created a recordset with a JOIN query, I would still need a routine
> to list the MANY contacts from the ONE company, hopefully in a small
> table.
>
> Thanks,
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-27, 3:29 pm |
| On Fri, 27 Feb 2004 12:57:13 -0500, "Kevin Spencer"
<kevin@takempis.com> wrote:
>Hi Larry,
>
>With a JOIN query, the single parent record data will be duplicated in each
>row of the result set, along with the data from the second table. If you
>only want to display the company info one time, you just omit that data when
>looping to display the related data.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I actually accomplished this using both methods (two recordsets, OR
one JOIN query)
Results?
using the JOIN method (which I like and plan to keep in mind for a lot
of other projects), i got the recordset i wanted, placed the company
table info at the top where it needed to be, then where i wanted my
contacts to appear, i ran the loop that spit out the contacts i wanted
(tho not in a table...just one per line,which i think i like better)
only problem was that below the list of contacts, where i wanted to
put some additional company info, i got an error...something about the
recordset needed to be BOF or EOF or something, so I think that once i
did the loop, I couldn't reference any more of the company table.
Trying again now using the 2 recordsets method and will adivse.
thanks for your input.
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Kevin Spencer 2004-02-27, 4:29 pm |
| Hi Larry,
Yes, once you've looped through the RecordSet, you can't get any data from
it (by default - let's keep this simple). However, you CAN grab that
information and put it into variables while the RecordSet is open, and then
put it anywhere in the page. Just for future reference.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:ng4v30t3o05ca0nchcek5s8nd7tp4bkb3q@4ax.com...
> On Fri, 27 Feb 2004 12:57:13 -0500, "Kevin Spencer"
> <kevin@takempis.com> wrote:
>
each[color=darkred]
when[color=darkred]
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> I actually accomplished this using both methods (two recordsets, OR
> one JOIN query)
>
> Results?
>
> using the JOIN method (which I like and plan to keep in mind for a lot
> of other projects), i got the recordset i wanted, placed the company
> table info at the top where it needed to be, then where i wanted my
> contacts to appear, i ran the loop that spit out the contacts i wanted
> (tho not in a table...just one per line,which i think i like better)
>
> only problem was that below the list of contacts, where i wanted to
> put some additional company info, i got an error...something about the
> recordset needed to be BOF or EOF or something, so I think that once i
> did the loop, I couldn't reference any more of the company table.
>
> Trying again now using the 2 recordsets method and will adivse.
>
> thanks for your input.
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-27, 4:29 pm |
| On Fri, 27 Feb 2004 14:34:25 -0500, "Kevin Spencer"
<kevin@takempis.com> wrote:
>Hi Larry,
>
>Yes, once you've looped through the RecordSet, you can't get any data from
>it (by default - let's keep this simple). However, you CAN grab that
>information and put it into variables while the RecordSet is open, and then
>put it anywhere in the page. Just for future reference.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
yes, that thought occurred to me later. now if i can just find out how
to make one of the fields retrieved in the loop as a mailto:
hyperlink, i'll have this thing put to bed.
thanks to you and the others for all your insights.
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Kevin Spencer 2004-02-27, 5:29 pm |
| <a
href="mailto:<%=RecordSetName("ColumnName").Value%>"><%=RecordSetName("Colum
nName").Value%></a>
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:888v30dra0djr2us94u14t63mlc9l3q6gr@4ax.com...
> On Fri, 27 Feb 2004 14:34:25 -0500, "Kevin Spencer"
> <kevin@takempis.com> wrote:
>
from[color=darkred]
then[color=darkred]
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> yes, that thought occurred to me later. now if i can just find out how
> to make one of the fields retrieved in the loop as a mailto:
> hyperlink, i'll have this thing put to bed.
>
> thanks to you and the others for all your insights.
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-27, 11:28 pm |
| On Fri, 27 Feb 2004 16:16:02 -0500, "Kevin Spencer"
<kevin@takempis.com> wrote:
><a
>href="mailto:<%=RecordSetName("ColumnName").Value%>"><%=RecordSetName("Colum
>nName").Value%></a>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Thanks Kevin. But I can't seem to get it to work. Here is the
statement as is...can you show me how to integrate the href part?
thanks.
While Not crs.EOF
Response.Write crs("firstname")& " " & crs("lastname")& ", "&
crs("title") & " " & crs("email")& "<br>"
crs.MoveNext
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-27, 11:28 pm |
| Larry,
Instead of using Response.Write, try:
While Not crs.EOF
<%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%> 
;<a href="mailto:<%=crs("email")%>"><%=crs("email")%></a><br>
crs.MoveNext
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:5f1040550c924mqdtih8kkachgncvq4tnj@4ax.com...
> On Fri, 27 Feb 2004 16:16:02 -0500, "Kevin Spencer"
> <kevin@takempis.com> wrote:
>
>
>href="mailto:<%=RecordSetName("ColumnName").Value%>"><%=RecordSetName("Colu
m
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Thanks Kevin. But I can't seem to get it to work. Here is the
> statement as is...can you show me how to integrate the href part?
> thanks.
>
> While Not crs.EOF
> Response.Write crs("firstname")& " " & crs("lastname")& ", "&
> crs("title") & " " & crs("email")& "<br>"
> crs.MoveNext
>
> Larry
>
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-28, 12:28 am |
| On Fri, 27 Feb 2004 22:26:10 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
wrote:
>Larry,
>
>Instead of using Response.Write, try:
>
>While Not crs.EOF
><%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%> 
>;<a href="mailto:<%=crs("email")%>"><%=crs("email")%></a><br>
>crs.MoveNext
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
looks right....but it doesn't run.
if you put a <% in front of your statements, and a %> afterwards, it
doesn't seem to look right in my frontpage page. the last part is
black instead of brown, if you know what i mean. is something left
out?
thanks,
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-28, 12:28 am |
| Sorry.
Do/Try..
<% While Not crs.EOF %>
<%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%> 
;<a href="mailto:<%=crs("email")%>"><%=crs("email")%></a><br>
<% crs.MoveNext %>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:kc3040h4hu0p93299vj9nho2a9k2eokitv@4ax.com...
> On Fri, 27 Feb 2004 22:26:10 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
> wrote:
>
>
><%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%>&nbs
p
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> looks right....but it doesn't run.
>
> if you put a <% in front of your statements, and a %> afterwards, it
> doesn't seem to look right in my frontpage page. the last part is
> black instead of brown, if you know what i mean. is something left
> out?
>
> thanks,
>
> Larry
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-28, 12:28 am |
| On Fri, 27 Feb 2004 22:58:43 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
wrote:
>Sorry.
>
>Do/Try..
>
>
><% While Not crs.EOF %>
><%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%> 
>;<a href="mailto:<%=crs("email")%>"><%=crs("email")%></a><br>
><% crs.MoveNext %>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
works like a dream! (just had to add the "Wend" at the end. Your idea
about using the two recordsets worked well for what I was doing, too.
This is the way I did it....tho i'm not too sure if it's the most
efficient way...and of course i'll kill the recordsets at the end and
set them to nothing.
strID = Request.QueryString("ID")
Set ars = Server.CreateObject("ADODB.RecordSet")
Set crs = Server.CreateObject("ADODB.RecordSet")
aq = "SELECT * FROM agents1 WHERE ID = "&strID&""
cq = "SELECT firstname,lastname,title,email FROM contacts WHERE ID =
"&strID&""
ars.Open aq, agents
crs.Open cq, agents
Thanks again Thomas!
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-28, 12:28 am |
| Larry,
Great!
I basically set the recordset up completely separate, so that I can easily
re-used/copy them to other pages, if needed.
But your way works the same.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:4q4040519n078ien94cfeep122tsfq855a@4ax.com...
> On Fri, 27 Feb 2004 22:58:43 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
> wrote:
>
>
><%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%>&nbs
p
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> works like a dream! (just had to add the "Wend" at the end. Your idea
> about using the two recordsets worked well for what I was doing, too.
>
> This is the way I did it....tho i'm not too sure if it's the most
> efficient way...and of course i'll kill the recordsets at the end and
> set them to nothing.
>
> strID = Request.QueryString("ID")
> Set ars = Server.CreateObject("ADODB.RecordSet")
> Set crs = Server.CreateObject("ADODB.RecordSet")
> aq = "SELECT * FROM agents1 WHERE ID = "&strID&""
> cq = "SELECT firstname,lastname,title,email FROM contacts WHERE ID =
> "&strID&""
> ars.Open aq, agents
> crs.Open cq, agents
>
> Thanks again Thomas!
>
> Larry
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| MD Websunlimited 2004-02-28, 9:28 am |
| Ouch. The single response.write is much better than the implied multiple statements being used here.
--
Mike -- FrontPage MVP '97 - '02
http://www.websunlimited.com
Our latest products "At Your Command" and IncludeASP
http://www.websunlimited.com/order/Product/AYC/ayc.htm
http://www.websunlimited.com/order/.../includeASP.htm
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:Ossdbqa$DHA.792@TK2MSFTNGP11.phx.gbl...
> Larry,
>
> Instead of using Response.Write, try:
>
> While Not crs.EOF
> <%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%> 
> ;<a href="mailto:<%=crs("email")%>"><%=crs("email")%></a><br>
> crs.MoveNext
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "Larry Rekow" <larry@netgeexdotcom> wrote in message
> news:5f1040550c924mqdtih8kkachgncvq4tnj@4ax.com...
> m
>
>
| |
| MD Websunlimited 2004-02-28, 9:28 am |
| Larry,
There are performance draw backs to using two recordsets instead of a "join" but as long as you're happy with it and it does not
drag your pages down.
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Larry Rekow" <larry@netgeexdotcom> wrote in message news:4q4040519n078ien94cfeep122tsfq855a@4ax.com...
> On Fri, 27 Feb 2004 22:58:43 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
> wrote:
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> works like a dream! (just had to add the "Wend" at the end. Your idea
> about using the two recordsets worked well for what I was doing, too.
>
> This is the way I did it....tho i'm not too sure if it's the most
> efficient way...and of course i'll kill the recordsets at the end and
> set them to nothing.
>
> strID = Request.QueryString("ID")
> Set ars = Server.CreateObject("ADODB.RecordSet")
> Set crs = Server.CreateObject("ADODB.RecordSet")
> aq = "SELECT * FROM agents1 WHERE ID = "&strID&""
> cq = "SELECT firstname,lastname,title,email FROM contacts WHERE ID =
> "&strID&""
> ars.Open aq, agents
> crs.Open cq, agents
>
> Thanks again Thomas!
>
> Larry
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-28, 10:29 am |
| Can you state exactly what the performance hit is, in exact terms?
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:%23Q8wd5f$DHA.1456@TK2MSFTNGP09.phx.gbl...
> Larry,
>
> There are performance draw backs to using two recordsets instead of a
"join" but as long as you're happy with it and it does not
> drag your pages down.
>
> --
> Mike -- FrontPage MVP '09 - '02
> http://www.websunlimited.com
>
>
> "Larry Rekow" <larry@netgeexdotcom> wrote in message
news:4q4040519n078ien94cfeep122tsfq855a@4ax.com...
><%=crs("firstname")%> <%=crs("lastname")%>, <%=crs("title")%>&nbs
p
>
>
| |
| Larry Rekow 2004-02-28, 12:28 pm |
| On Sat, 28 Feb 2004 07:22:49 -0600, "MD Websunlimited" <none@none.com>
wrote:
>Ouch. The single response.write is much better than the implied multiple statements being used here.
++++++++++++++++++++++++++++++++++++++++++++
I'll keep that in mind. This is an intranet for a company with a total
of about 100 people, and I very much doubt more than 8 or 10 ppl would
be on it at any given time, so I'm not trying to optimize the site for
speed. I'll give it a try with the JOIN statement as well just to see
if I can pick up any difference. But I think I may stick with the
multiple statements to break things up, because I want an "IF...THEN"
around the "title" field, in case the contact person doesn't have one,
so there is not an unnecessary comma after the person's name, if you
know what I mean.
The page is going live next week and I'll have a few key ppl watch out
for any speed problems.
Thanks,
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-28, 12:28 pm |
| Larry,
You shouldn't have any performance issue, especially if on a intranet, when
opening two or more recordsets.
There are many times when it is just not to possible to use a Join, such as
in a shopping cart application, where you are display the cart total, while
the user is still shopping for products, so you have a recordset that
displaying the cart total, as well as a recordset displaying products, etc.
I use them frequently in all of my projects.
Examples:
http://www.glassart.biz
http://www.ourcondo.com
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:nvd140lcbhn0koop7sv5mucr5ttcphf7mj@4ax.com...
> On Sat, 28 Feb 2004 07:22:49 -0600, "MD Websunlimited" <none@none.com>
> wrote:
>
statements being used here.[color=darkred]
> ++++++++++++++++++++++++++++++++++++++++++++
> I'll keep that in mind. This is an intranet for a company with a total
> of about 100 people, and I very much doubt more than 8 or 10 ppl would
> be on it at any given time, so I'm not trying to optimize the site for
> speed. I'll give it a try with the JOIN statement as well just to see
> if I can pick up any difference. But I think I may stick with the
> multiple statements to break things up, because I want an "IF...THEN"
> around the "title" field, in case the contact person doesn't have one,
> so there is not an unnecessary comma after the person's name, if you
> know what I mean.
>
> The page is going live next week and I'll have a few key ppl watch out
> for any speed problems.
>
> Thanks,
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| MD Websunlimited 2004-02-28, 3:28 pm |
| In exact terms -- give me a break this isn't really the forum for that.
In a nut shell you have two recordsets that must be instanuated instead of one. You have two memory buffer areas etc. All of which
require build up and tear down. I would think that this should be obvious.
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:u%23M%23N%23f$DHA.4072@tk2msftngp13.phx.gbl...
> Can you state exactly what the performance hit is, in exact terms?
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "MD Websunlimited" <none@none.com> wrote in message
> news:%23Q8wd5f$DHA.1456@TK2MSFTNGP09.phx.gbl...
> "join" but as long as you're happy with it and it does not
> news:4q4040519n078ien94cfeep122tsfq855a@4ax.com...
> p
>
>
| |
| MD Websunlimited 2004-02-28, 4:28 pm |
| I would doubt you'd see any speed problems from doing it Tom's way. The problem is that if you get in the habit of coding in that
manner you may run into issues at some kther time or tax the server before its time.
There are a lot of ways to accomplish things that achieve the same results but some are just better than others. Doing statements
like
<% =rs("FirstName") %>
<br>
<% =rs("LastName") %>
<br>
<% =rs("Address1") %>
Is an example of poor programming, IMHO, unless there is an real need.
This is even better than the above but not by much
<%
response.write rs("FirstName") & "<br>"
response.write rs("LastName") & "<br>"
response.write rs("Address1")
%>
And this is the would be proper method IMHO and it is a "Best Practice"
<%
response.write rs("FirstName") & "<br>" & rs("LastName") & "<br>" & rs("Address1")
%>
Remember this is interperted code that is not optimized.
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Larry Rekow" <larry@netgeexdotcom> wrote in message news:nvd140lcbhn0koop7sv5mucr5ttcphf7mj@4ax.com...
> On Sat, 28 Feb 2004 07:22:49 -0600, "MD Websunlimited" <none@none.com>
> wrote:
>
> ++++++++++++++++++++++++++++++++++++++++++++
> I'll keep that in mind. This is an intranet for a company with a total
> of about 100 people, and I very much doubt more than 8 or 10 ppl would
> be on it at any given time, so I'm not trying to optimize the site for
> speed. I'll give it a try with the JOIN statement as well just to see
> if I can pick up any difference. But I think I may stick with the
> multiple statements to break things up, because I want an "IF...THEN"
> around the "title" field, in case the contact person doesn't have one,
> so there is not an unnecessary comma after the person's name, if you
> know what I mean.
>
> The page is going live next week and I'll have a few key ppl watch out
> for any speed problems.
>
> Thanks,
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-28, 5:28 pm |
| None of the sites that I have developed are experiencing any problems or
performance issues because of this method. Each of us has our own way of
programming and to use one method over another, is a choice we each make
depending on the project. This does not make for poor or bad programming.
Bad or poor programming is programming the crashed the application or the
server.
Using the shortcut Response.Write statement is a well accepted means of
coding, and it is lot faster to write and debug then to use Response.Write
statement.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:uRw$oIj$DHA.392@TK2MSFTNGP12.phx.gbl...
> I would doubt you'd see any speed problems from doing it Tom's way. The
problem is that if you get in the habit of coding in that
> manner you may run into issues at some other time or tax the server before
its time.
>
> There are a lot of ways to accomplish things that achieve the same results
but some are just better than others. Doing statements
> like
>
> <% =rs("FirstName") %>
> <br>
> <% =rs("LastName") %>
> <br>
> <% =rs("Address1") %>
>
> Is an example of poor programming, IMHO, unless there is an real need.
>
> This is even better than the above but not by much
> <%
> response.write rs("FirstName") & "<br>"
> response.write rs("LastName") & "<br>"
> response.write rs("Address1")
> %>
>
> And this is the would be proper method IMHO and it is a "Best Practice"
> <%
> response.write rs("FirstName") & "<br>" & rs("LastName") & "<br>" &
rs("Address1")
> %>
>
> Remember this is interperted code that is not optimized.
> --
> Mike -- FrontPage MVP '09 - '02
> http://www.websunlimited.com
>
>
>
> "Larry Rekow" <larry@netgeexdotcom> wrote in message
news:nvd140lcbhn0koop7sv5mucr5ttcphf7mj@4ax.com...
multiple statements being used here.[color=darkred]
>
>
| |
| MD Websunlimited 2004-02-28, 5:29 pm |
| I'm sure your websites are not. Your style of writing ASP code is not one that I would recommend to someone learning ASP. You have
your opinion and I have mine - that is what is meant by IMHO.
See http://msdn.microsoft.com/library/d...tml/asptips.asp see Tip #15
You can have poor programming Thomas that does not crash the program.
We've disagreed on this before and we'll continue to disagee at this time.
--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Create fast, better scaling link bars with CSS Menu Maker
http://www.websunlimited.com/order/...nu/css_menu.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:uacBwnj$DHA.2348@TK2MSFTNGP09.phx.gbl...
> None of the sites that I have developed are experiencing any problems or
> performance issues because of this method. Each of us has our own way of
> programming and to use one method over another, is a choice we each make
> depending on the project. This does not make for poor or bad programming.
>
> Bad or poor programming is programming the crashed the application or the
> server.
>
> Using the shortcut Response.Write statement is a well accepted means of
> coding, and it is lot faster to write and debug then to use Response.Write
> statement.
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "MD Websunlimited" <none@none.com> wrote in message
> news:uRw$oIj$DHA.392@TK2MSFTNGP12.phx.gbl...
> problem is that if you get in the habit of coding in that
> its time.
> but some are just better than others. Doing statements
> rs("Address1")
> news:nvd140lcbhn0koop7sv5mucr5ttcphf7mj@4ax.com...
> multiple statements being used here.
>
>
| |
| Larry Rekow 2004-02-28, 5:29 pm |
| On Sat, 28 Feb 2004 07:25:39 -0600, "MD Websunlimited" <none@none.com>
wrote:
>Larry,
>
>There are performance draw backs to using two recordsets instead of a "join" but as long as you're happy with it and it does not
>drag your pages down.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mike, I've come across a wrinkle using the JOIN method.
Some of my company table records don't have any contact table records
to join to. That is, there are no recorded entries yet for any
contacts at some companies. When this happens, I get an error opening
the page, saying:
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
I tried putting an IF...Then thing around the loop of contacts, so it
wouldn't try to list the contacts if there weren't any, but it didn't
help.
if i add a dummy contact to the company....that is, if i give the
company table something to JOIN to, then it works fine.
Is this to be expected? And is there a workaround short of creating a
blank contact record?
Thanks,
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-28, 6:29 pm |
| On Fri, 27 Feb 2004 23:23:10 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
wrote:
>Larry,
>
>Great!
>
>I basically set the recordset up completely separate, so that I can easily
>re-used/copy them to other pages, if needed.
>
>But your way works the same.
++++++++++++++++++++++++++++++++++++++++++++++++++++
Hi Thomas,
I'm coming up on a situation where some of the companies don't have
any corresponding contacts in the contacts table. Therefore, I
imagine that a contacts recordset doesn't get created. I'm trying to
put an IF/Then condition so that the contacts loops doesn't happen if
there are no contacts. Is there a simple way to test if the recordset
exists at all? When i try to say:
IF crs("firstname") > "" Then
or somesuch, the page doesn't run, and i'm guessing that it's because
there is no such field to test since there is no such recordset.
If I let the loop run, it works, and nothing is produced...which is
sorta ok, but i wanted to test if there were any contacts at all
first, so i wouldn't have the legend "Contacts:" sitting there with
nothing after it.
Thanks again,
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Larry Rekow 2004-02-28, 6:29 pm |
| On Sat, 28 Feb 2004 13:37:04 -0800, Larry Rekow <larry@netgeexdotcom>
wrote:
>On Fri, 27 Feb 2004 23:23:10 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
>wrote:
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++
>Hi Thomas,
>
>I'm coming up on a situation where some of the companies don't have
>any corresponding contacts in the contacts table. Therefore, I
>imagine that a contacts recordset doesn't get created. I'm trying to
>put an IF/Then condition so that the contacts loops doesn't happen if
>there are no contacts. Is there a simple way to test if the recordset
>exists at all?
<snip>
Whoops...i figured it out....i put a "IF NOT crs.EOF...
and that worked....
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-28, 6:29 pm |
| The trend is toward separating code from HTML, the same as the concept of
using CSS to separate layout from the content, so by using Response.Write
statements, you can not achieve this.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:%23MnU42j$DHA.3256@TK2MSFTNGP09.phx.gbl...
> I'm sure your websites are not. Your style of writing ASP code is not one
that I would recommend to someone learning ASP. You have
> your opinion and I have mine - that is what is meant by IMHO.
>
> See
http://msdn.microsoft.com/library/d...tml/asptips.asp
see Tip #15
>
> You can have poor programming Thomas that does not crash the program.
>
> We've disagreed on this before and we'll continue to disagee at this time.
>
> --
> Mike -- FrontPage MVP '97-'02
> http://www.websunlimited.com
> Create fast, better scaling link bars with CSS Menu Maker
> http://www.websunlimited.com/order/...nu/css_menu.htm
> FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
>
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:uacBwnj$DHA.2348@TK2MSFTNGP09.phx.gbl...
programming.[color=darkred]
the[color=darkred]
Response.Write[color=darkred]
The[color=darkred]
before[color=darkred]
results[color=darkred]
Practice"[color=darkred]
<none@none.com>[color=darkred]
total[color=darkred]
would[color=darkred]
for[color=darkred]
see[color=darkred]
"IF...THEN"[color=darkred]
one,[color=darkred]
out[color=darkred]
>
>
| |
| Thomas A. Rowe 2004-02-28, 6:29 pm |
| Great!
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:3v3240loat7pam4o3peucnup2sdhbqk83r@4ax.com...
> On Sat, 28 Feb 2004 13:37:04 -0800, Larry Rekow <larry@netgeexdotcom>
> wrote:
>
easily[color=darkred]
> <snip>
> Whoops...i figured it out....i put a "IF NOT crs.EOF...
>
> and that worked....
>
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| MD Websunlimited 2004-02-28, 7:28 pm |
| Larry,
Has the database been normalized to third normal form?
What is your referential integrity for the various tables?
Referential integrity is when you have must have at least a one to one relationship between tables. Access, when set up correctly,
will enforce it. See
http://office.microsoft.com/assista...eryID=ET-5oeX53
--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Create fast, better scaling link bars with CSS Menu Maker
http://www.websunlimited.com/order/...nu/css_menu.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
"Larry Rekow" <larry@netgeexdotcom> wrote in message news:vl02405cbevh01qst0dnu23biqd5u2cpaj@4ax.com...
> On Sat, 28 Feb 2004 07:25:39 -0600, "MD Websunlimited" <none@none.com>
> wrote:
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Mike, I've come across a wrinkle using the JOIN method.
>
> Some of my company table records don't have any contact table records
> to join to. That is, there are no recorded entries yet for any
> contacts at some companies. When this happens, I get an error opening
> the page, saying:
>
> Either BOF or EOF is True, or the current record has been deleted.
> Requested operation requires a current record.
>
> I tried putting an IF...Then thing around the loop of contacts, so it
> wouldn't try to list the contacts if there weren't any, but it didn't
> help.
>
> if i add a dummy contact to the company....that is, if i give the
> company table something to JOIN to, then it works fine.
>
> Is this to be expected? And is there a workaround short of creating a
> blank contact record?
>
> Thanks,
>
> Larry
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| MD Websunlimited 2004-02-28, 7:28 pm |
| I agree with your statement but I'm at a lost as to what it has to do with the topic at hand.
But if you'd like to change the topic....
Moving code behind HTML is great but not possible to accomplish in ASP and it has nothing to do with response.write statements. In
ASP.NET it is a breeze and the recommend methodology -- not to mention the most efficient.
Yes CSS should be used to separate layout from content but to accomplish that you'd have to stop using tables and start using CSS
layout. All I've ever seen you post is to use tables for layout. You can't have it both ways. Doing table-less design is very doable
and is being done by the best web designers out there. Example sites: Amazon.com or ESPN.com.
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:eBeJImk$DHA.624@TK2MSFTNGP11.phx.gbl...
> The trend is toward separating code from HTML, the same as the concept of
> using CSS to separate layout from the content, so by using Response.Write
> statements, you can not achieve this.
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "MD Websunlimited" <none@none.com> wrote in message
> news:%23MnU42j$DHA.3256@TK2MSFTNGP09.phx.gbl...
> that I would recommend to someone learning ASP. You have
> http://msdn.microsoft.com/library/d...tml/asptips.asp
> see Tip #15
> news:uacBwnj$DHA.2348@TK2MSFTNGP09.phx.gbl...
> programming.
> the
> Response.Write
> The
> before
> results
> Practice"
> <none@none.com>
> total
> would
> for
> see
> "IF...THEN"
> one,
> out
>
>
| |
| Thomas A. Rowe 2004-02-28, 8:28 pm |
| This applies to this topic.
By using <%=rs("Whatever")%>, I can easily apply fonts tags (or CSS, it I
used it) or with <% If... %>, I can surround complete blocks of HTML code,
that would be fully functional (similar to CSS for layout, which I don't use
or see a need to use), without the ASP code, whereas when using a
Response.Write statement, the HTML code can not stand on it own, nor can you
see the content of a Response.Write statement in FP's Normal view, so you
spend more time trying to layout out pages.
"What Your Time Worth?" <smile>
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:ebkLkAl$DHA.2348@TK2MSFTNGP09.phx.gbl...
> I agree with your statement but I'm at a lost as to what it has to do with
the topic at hand.
>
> But if you'd like to change the topic....
>
> Moving code behind HTML is great but not possible to accomplish in ASP and
it has nothing to do with response.write statements. In
> ASP.NET it is a breeze and the recommend methodology -- not to mention the
most efficient.
>
> Yes CSS should be used to separate layout from content but to accomplish
that you'd have to stop using tables and start using CSS
> layout. All I've ever seen you post is to use tables for layout. You can't
have it both ways. Doing table-less design is very doable
> and is being done by the best web designers out there. Example sites:
Amazon.com or ESPN.com.
>
> --
> Mike -- FrontPage MVP '09 - '02
> http://www.websunlimited.com
>
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:eBeJImk$DHA.624@TK2MSFTNGP11.phx.gbl...
of[color=darkred]
Response.Write[color=darkred]
one[color=darkred]
http://msdn.microsoft.com/library/d...tml/asptips.asp[color=darkred]
time.[color=darkred]
problems or[color=darkred]
way of[color=darkred]
make[color=darkred]
or[color=darkred]
of[color=darkred]
way.[color=darkred]
server[color=darkred]
need.[color=darkred]
&[color=darkred]
site[color=darkred]
to[color=darkred]
the[color=darkred]
have[color=darkred]
you[color=darkred]
watch[color=darkred]
>
>
| |
| Thomas A. Rowe 2004-02-29, 5:28 am |
| My method of use <% ... %> (Interleaved text) is faster then using
Response.Write statements!
See:
http://www.4guysfromrolla.com/webtech/021302-1.shtml
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:uRw$oIj$DHA.392@TK2MSFTNGP12.phx.gbl...
> I would doubt you'd see any speed problems from doing it Tom's way. The
problem is that if you get in the habit of coding in that
> manner you may run into issues at some other time or tax the server before
its time.
>
> There are a lot of ways to accomplish things that achieve the same results
but some are just better than others. Doing statements
> like
>
> <% =rs("FirstName") %>
> <br>
> <% =rs("LastName") %>
> <br>
> <% =rs("Address1") %>
>
> Is an example of poor programming, IMHO, unless there is an real need.
>
> This is even better than the above but not by much
> <%
> response.write rs("FirstName") & "<br>"
> response.write rs("LastName") & "<br>"
> response.write rs("Address1")
> %>
>
> And this is the would be proper method IMHO and it is a "Best Practice"
> <%
> response.write rs("FirstName") & "<br>" & rs("LastName") & "<br>" &
rs("Address1")
> %>
>
> Remember this is interperted code that is not optimized.
> --
> Mike -- FrontPage MVP '09 - '02
> http://www.websunlimited.com
>
>
>
> "Larry Rekow" <larry@netgeexdotcom> wrote in message
news:nvd140lcbhn0koop7sv5mucr5ttcphf7mj@4ax.com...
multiple statements being used here.[color=darkred]
>
>
| |
| Thomas A. Rowe 2004-02-29, 5:28 am |
| The MSDN ASP Tips #15 appears targeted towards using ASP under NT4/IIS4
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:%23MnU42j$DHA.3256@TK2MSFTNGP09.phx.gbl...
> I'm sure your websites are not. Your style of writing ASP code is not one
that I would recommend to someone learning ASP. You have
> your opinion and I have mine - that is what is meant by IMHO.
>
> See
http://msdn.microsoft.com/library/d...tml/asptips.asp
see Tip #15
>
> You can have poor programming Thomas that does not crash the program.
>
> We've disagreed on this before and we'll continue to disagee at this time.
>
> --
> Mike -- FrontPage MVP '97-'02
> http://www.websunlimited.com
> Create fast, better scaling link bars with CSS Menu Maker
> http://www.websunlimited.com/order/...nu/css_menu.htm
> FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
>
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:uacBwnj$DHA.2348@TK2MSFTNGP09.phx.gbl...
programming.[color=darkred]
the[color=darkred]
Response.Write[color=darkred]
The[color=darkred]
before[color=darkred]
results[color=darkred]
Practice"[color=darkred]
<none@none.com>[color=darkred]
total[color=darkred]
would[color=darkred]
for[color=darkred]
see[color=darkred]
"IF...THEN"[color=darkred]
one,[color=darkred]
out[color=darkred]
>
>
| |
| Larry Rekow 2004-02-29, 1:28 pm |
| On Sun, 29 Feb 2004 03:35:28 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
wrote:
>My method of use <% ... %> (Interleaved text) is faster then using
>Response.Write statements!
>
>See:
>http://www.4guysfromrolla.com/webtech/021302-1.shtml
++++++++++++++++++++++++++++++++++++++++++++++++++++
While we're on the subject of different methods, I was using this
page:
http://www.asp101.com/samples/viewa...%5Fsearch%2Easp
to get some code to help me create a table with some d/b output. And
he uses this method: <%= rstSearch.Fields("first_name").Value %>
How is that different from your method? Or is it just a different way
of writing the same thing?
thanks,
Larry
- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown."
| |
| Thomas A. Rowe 2004-02-29, 5:29 pm |
| Just a different way of writing the same thing.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"Larry Rekow" <larry@netgeexdotcom> wrote in message
news:458440982kkk6hsj3j3ft9eup2gfu6ke89@4ax.com...
> On Sun, 29 Feb 2004 03:35:28 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
> wrote:
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
> While we're on the subject of different methods, I was using this
> page:
>
> http://www.asp101.com/samples/viewa...%5Fsearch%2Easp
>
> to get some code to help me create a table with some d/b output. And
> he uses this method: <%= rstSearch.Fields("first_name").Value %>
> How is that different from your method? Or is it just a different way
> of writing the same thing?
>
> thanks,
>
> Larry
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| MD Websunlimited 2004-02-29, 7:29 pm |
| Thomas,
This article looks at a sample in an optimized loop it is not the same as having:
<% =rs("FirstName") %>
<br>
<% =rs("LastName") %>
<br>
<% =rs("Address1") %>
The MS KB article that I references IIS5.0 so I don't see where you came to the conclusion that is addresses only IIS 4.0 At the
bottom of the KB:
Professional Active Server Pages 3.0, Wrox Press. (Especially Chapter 26: Optimizing ASP Performance, by George Reilly and
Matthew Gibbs)
a.. Microsoft Internet Information Services 5.0 Resource Guide (bundled with Windows 2000 Server Resource Kit, Microsoft Press.
b.. Microsoft Internet Information Server Resource Kit (for IIS 4.0), Microsoft Press.
c.. Programming Distributed Applications with COM and Microsoft Visual Basic 6.0 by Ted Pattison, Microsoft Press.
d.. Effective COM by Don Box, Keith Brown, Tim Ewald, and Chris Sells; Addison-Wesley.
e.. Developing Web Usability: The Practice of Simplicity by Jakob Nielsen, New Riders.
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:uHyu47p$DHA.1844@TK2MSFTNGP11.phx.gbl...
> My method of use <% ... %> (Interleaved text) is faster then using
> Response.Write statements!
>
> See:
> http://www.4guysfromrolla.com/webtech/021302-1.shtml
>
> --
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "MD Websunlimited" <none@none.com> wrote in message
> news:uRw$oIj$DHA.392@TK2MSFTNGP12.phx.gbl...
> problem is that if you get in the habit of coding in that
> its time.
> but some are just better than others. Doing statements
> rs("Address1")
> news:nvd140lcbhn0koop7sv5mucr5ttcphf7mj@4ax.com...
> multiple statements being used here.
>
>
| |
| MD Websunlimited 2004-02-29, 7:29 pm |
| Larry,
The equal symbol is just short hand for writing response.write. Thomas and my debate is about mixing text with code.
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Larry Rekow" <larry@netgeexdotcom> wrote in message news:458440982kkk6hsj3j3ft9eup2gfu6ke89@4ax.com...
> On Sun, 29 Feb 2004 03:35:28 -0500, "Thomas A. Rowe" <tarowe@mvps.org>
> wrote:
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++
> While we're on the subject of different methods, I was using this
> page:
>
> http://www.asp101.com/samples/viewa...%5Fsearch%2Easp
>
> to get some code to help me create a table with some d/b output. And
> he uses this method: <%= rstSearch.Fields("first_name").Value %>
> How is that different from your method? Or is it just a different way
> of writing the same thing?
>
> thanks,
>
> Larry
>
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."
| |
| MD Websunlimited 2004-02-29, 7:29 pm |
| It is faster to write:
response.write rs("FirstName") & "<br>" & rs("LastName") & "<br>" & rs("Address1")
Than writing
<% =rs("FirstName") %>
<br>
<% =rs("LastName") %>
<br>
<% =rs("Address1") %>
What's your time worth?
<smile>
--
Mike -- FrontPage MVP '09 - '02
http://www.websunlimited.com
"Thomas A. Rowe" <tarowe@mvps.org> wrote in message news:eBpaXSl$DHA.808@TK2MSFTNGP12.phx.gbl...
> This applies to this topic.
>
> By using <%=rs("Whatever")%>, I can easily apply fonts tags (or CSS, it I
> used it) or with <% If... %>, I can surround complete blocks of HTML code,
> that would be fully functional (similar to CSS for layout, which I don't use
> or see a need to use), without the ASP code, whereas when using a
> Response.Write statement, the HTML code can not stand on it own, nor can you
> see the content of a Response.Write statement in FP's Normal view, so you
> spend more time trying to layout out pages.
>
> "What Your Time Worth?" <smile>
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "MD Websunlimited" <none@none.com> wrote in message
> news:ebkLkAl$DHA.2348@TK2MSFTNGP09.phx.gbl...
> the topic at hand.
> it has nothing to do with response.write statements. In
> most efficient.
> that you'd have to stop using tables and start using CSS
> have it both ways. Doing table-less design is very doable
> Amazon.com or ESPN.com.
> news:eBeJImk$DHA.624@TK2MSFTNGP11.phx.gbl...
> of
> Response.Write
> one
> http://msdn.microsoft.com/library/d...tml/asptips.asp
> time.
> problems or
> way of
> make
> or
> of
> way.
> server
> need.
> &
> site
> to
> the
> have
> you
> watch
>
>
| |
| Thomas A. Rowe 2004-02-29, 8:28 pm |
| I disagree! The reference I provided explains how a Classic ASP page is
processed under IIS 5 and shows my method as being the better choice in
terms of overall "speed" performance vs. IIS4, where using the method you
prefer, seem to be a better coding choice.
See:
http://www.4guysfromrolla.com/webtech/010202-1.shtml
However, as the author indicating at the bottom of the first link provided,
it is all up to the individual which one to use, neither is bad or as you
put it "poor" programming.
Bottom-line: You code your way, and I will code my way and help folks here
in the way I know best. Everyone that does write HTML, ASP or JavaScript
coding, has or develops their own method of working, which doesn't make the
method they choose, right or wrong.
When I original post my reply, I didn't say that it was the best or the only
way to accomplish the results the user was looking to achieve, which he was
able to do. Second, my reply was actually a clarification of Kevin Spencer's
reply to the user, which happen to be the same method I use
I would appreciate you not labeling my method of coding as "poor" bad or
whatever, just because you prefer to use another method. I don't label your
J-bots products in a negative way, just because I prefer not to use them (or
any other add-ins for that matter).
I don't have a problem with you (or anyone) correcting a post of mine,
however I will take issue, if the tone of the response is such that my
suggestion/solution, etc. is wrong when the newly provided
suggestion/solution, is strictly based on the personal preferences of the
poster.
--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
"MD Websunlimited" <none@none.com> wrote in message
news:eG1Q1lx$DHA.624@TK2MSFTNGP11.phx.gbl...
> Thomas,
>
> This article looks at a sample in an optimized loop it is not the same as
having:
>
> <% =rs("FirstName") %>
> <br>
> <% =rs("LastName") %>
> <br>
> <% =rs("Address1") %>
>
> The MS KB article that I references IIS5.0 so I don't see where you came
to the conclusion that is addresses only IIS 4.0 At the
> bottom of the KB:
>
>
> Professional Active Server Pages 3.0, Wrox Press. (Especially
Chapter 26: Optimizing ASP Performance, by George Reilly and
> Matthew Gibbs)
> a.. Microsoft Internet Information Services 5.0 Resource Guide (bundled
with Windows 2000 Server Resource Kit, Microsoft Press.
> b.. Microsoft Internet Information Server Resource Kit (for IIS 4.0),
Microsoft Press.
> c.. Programming Distributed Applications with COM and Microsoft Visual
Basic 6.0 by Ted Pattison, Microsoft Press.
> d.. Effective COM by Don Box, Keith Brown, Tim Ewald, and Chris Sells;
Addison-Wesley.
> e.. Developing Web Usability: The Practice of Simplicity by Jakob
Nielsen, New Riders.
>
>
>
> "Thomas A. Rowe" <tarowe@mvps.org> wrote in message
news:uHyu47p$DHA.1844@TK2MSFTNGP11.phx.gbl...
The[color=darkred]
before[color=darkred]
results[color=darkred]
Practice"[color=darkred]
<none@none.com>[color=darkred]
total[color=darkred]
would[color=darkred]
for[color=darkred]
see[color=darkred]
"IF...THEN"[color=darkred]
one,[color=darkred]
out[color=darkred]
>
>
|
|
|
| | Copyright 2003 - 2008 forum4designers.com Software forum Computer Hardware reviews |
|