Fog Creek Software
Discussion Board




Retrieving data based on login & appending in ASP

Hi, I've been introduced to asp, and told it would resolve much of my current probloems.
My asp is currently horrible, But I clearly know what I need. So any help on the below would greatly be appreciated.
I have a db called RedCrossAsia.mdb


the db is as follows.
 
(tblLogin)
Name
Password
Initials

(tblAidOrigin)
AOID
Origin
Initials

(tblAidDestination)
ADID
Destination
Initials

(tblPacks)
PackID
Destination
Origin
Status
etc etc


An example of the data in tblLogin, would be
Login: Bintan,
Password: rc24334
initials Btn
(Bintan is a name of a village, not a person)
There are 27 different location logins.


Now on the physical aid packages, I write first the initials of our location(origin), then the number assigned to that pack.

So in the context of asp, if I'm located in Surubaya, the intials SRB (from login table) need be appended to the pack no, eg 1234
(1234 would have been entered into a textbox. )
So in the PACKID (tblPacks), it would display SRB-1234.
I need SRB to be appended by default. Not typed in.
And the tblPack should only display the origin or destination according to the login, so if the login was Surabaya, then the PACKID records displayed would be according
to if 'Surabaya' appears in the origin or destination of tblPacks.

Any help would be deeply appreciated, Thankyou so much in advance.

Yasmine H.
Wednesday, July 16, 2003

So what is your question?

Li-fan Chen
Wednesday, July 16, 2003

Ok, sorry for that...

Question1:
I need to know in the context of asp, if I'm located in Surubaya, the intials SRB (from login table) need be appended to the pack no, eg 1234
(1234 would have been entered into a textbox. )
So in the PACKID (tblPacks), how would I get it to store SRB-1234.?
I need SRB to be appended by default. Not typed in.

Question 2:
Another thing, how would I go about displaying records of origin or destination from tblPacks, according to the login, so if the login was Surabaya, then the PACKID records would be displayed accordingly. Assuming 'Surabaya' appears in the origin or destination of tblPacks.

Yasmine H.
Wednesday, July 16, 2003

Question 1:

Run the following and assign it to objRS

" SELECT Initial    " & _
"  FROM tblLogin  " & _
"  WHERE Name =    " & Request("frmName")

When you have the Initial, insert it as part of PackID

" INSERT tblPacks (      " & _
"    PackID, ... " & _
" ) VALUES ( " & _
"'" & objRS("Initial") & Request("frmPackNumber") & "', ..." & _
" ) "

Li-fan Chen
Wednesday, July 16, 2003



Question 2:

Run the following and assign it to objRS

" SELECT Initial    " & _
"  FROM tblLogin  " & _
"  WHERE Name =    " & Request("frmName")

When you have the Initial

"  SELECT *        " & _
"    FROM tblPack  " & _
"    WHERE PackID like '" & objRS("Initial") & "%'"

Li-fan Chen
Wednesday, July 16, 2003

Sorry if I can't provide more detail.. time for some much needed sleep. :-)

Li-fan Chen
Wednesday, July 16, 2003

No worries, thanks heaps Li-Fan :)

Yasmine H.
Thursday, July 17, 2003

*  Recent Topics

*  Fog Creek Home