QueryString Parameter

R

rn5a

A MS-Access database table has 2 columns - UserID (unique) of number
data type & UserName (text) along with some other columns.

When users come to a particular page, say, AllUsers.asp, all the
UserNames are displayed to him as hyperlinks. Based on the UserName
clicked by a user, the next page (to which the user will be taken to
when he clicks any of the UserNames) will display more information
about that particular UserName (which the user had clicked).Assume
that the page where more info is displayed is named UserInfo.asp.
(Note that the info will also be retrieved from the DB table).
UserInfo.asp will also display the UserName the user had just clciked
in AllUsers.asp.

Now for UserInfo.asp to retrieve data about the UserName the user has
just clicked, I can make the links in AllUsers.asp pass the UserID as
well as the UserName as a querystring value. Now whcih one will be
more efficient - sending the UserID as the querystrinng value or
sending the UserName as the querystring value?
 
R

rn5a

A MS-Access database table has 2 columns - UserID (unique) of number
data type & UserName (text) along with some other columns.

When users come to a particular page, say, AllUsers.asp, all the
UserNames are displayed to him as hyperlinks. Based on the UserName
clicked by a user, the next page (to which the user will be taken to
when he clicks any of the UserNames) will display more information
about that particular UserName (which the user had clicked).Assume
that the page where more info is displayed is named UserInfo.asp.
(Note that the info will also be retrieved from the DB table).
UserInfo.asp will also display the UserName the user had just clciked
in AllUsers.asp.

Now for UserInfo.asp to retrieve data about the UserName the user has
just clicked, I can make the links in AllUsers.asp pass the UserID as
well as the UserName as a querystring value. Now whcih one will be
more efficient - sending the UserID as the querystrinng value or
sending the UserName as the querystring value?

ADDENDUM:
------------------

Sorry made some changes to the app. Here's the revised post:

When a user clicks a UserName in AllUsers.asp, he is first taken to an
ASP page named Page1.asp (& not UserInfo.asp). Page1.asp also has
links clicking which takes the user to UserInfo.asp which displays all
the UserName info.

Now Page1.asp displays a calendar & should also display the UserName
just clicked. As such, Page1.asp doesn't interact with the MS-Access
DB table. If I pass the UserID as the querystring value from
AllUsers.asp to Page1.asp, then that means I have to get the UserName
from the DB table since I am only passing the UserID as the
querystring value & not the UserName. On the other hand, if I pass
UserName as the querystring value from AllUsers.asp to Page1.asp, then
there won't be any need for Page1.asp to interact with the DB table.

So passing UserID as the querystring value which involves database
communication is recommended or passing UserName as the querystring
value which doesn't involve any database communication is recommended?
 
M

Mike Brind

ADDENDUM:
------------------

Sorry made some changes to the app. Here's the revised post:

When a user clicks a UserName in AllUsers.asp, he is first taken to an
ASP page named Page1.asp (& not UserInfo.asp). Page1.asp also has
links clicking which takes the user to UserInfo.asp which displays all
the UserName info.

Now Page1.asp displays a calendar & should also display the UserName
just clicked. As such, Page1.asp doesn't interact with the MS-Access
DB table. If I pass the UserID as the querystring value from
AllUsers.asp to Page1.asp, then that means I have to get the UserName
from the DB table since I am only passing the UserID as the
querystring value & not the UserName. On the other hand, if I pass
UserName as the querystring value from AllUsers.asp to Page1.asp, then
there won't be any need for Page1.asp to interact with the DB table.

So passing UserID as the querystring value which involves database
communication is recommended or passing UserName as the querystring
value which doesn't involve any database communication is recommended?

You're just thinking out loud, aren't you?
 
M

Mike Brind

Sorry, Mike, I couldn't exactly get you....

Well, calls to databases are expensive, and a good way to hamper the
scalability of a site. So the rule of thumb is only make calls when
absolutely necessary, and make them as short and sweet as possible. If you
already have a value on page1, and passing that value to page2 using the
querystring makes it available to that page thus negating an expensive
additional and unnecessary call to the database, I would have thought the
answer was self-evident.

Your post reads like someone mentally weighing up 2 options out loud, only
to arrive at the correct answer themselves, and therefore not requiring an
answer from anyone else. Hence my equally rhetorical response :)
 
R

rn5a

Well, calls to databases are expensive, and a good way to hamper the
scalability of a site. So the rule of thumb is only make calls when
absolutely necessary, and make them as short and sweet as possible. If you
already have a value on page1, and passing that value to page2 using the
querystring makes it available to that page thus negating an expensive
additional and unnecessary call to the database, I would have thought the
answer was self-evident.

Your post reads like someone mentally weighing up 2 options out loud, only
to arrive at the correct answer themselves, and therefore not requiring an
answer from anyone else. Hence my equally rhetorical response :)

Thanks, Mike, for your answer. Actually my English is not so good;
that's the reason why I couldn't understand your first response.

Anyway, thanks once again,

Regards,

RON
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top