top_left top_right
bottom_left
Next Event: Unknown | Forum Rules | QGL Website | Event Registration
openFolder AusForums.com
iconwatfolderLineopenFolder LANs
iconwatfolderLineopenFolder QGL
iconwatfolderLineopenFolder QGL Forum
Author
Topic: any one good with asp?
WarT
Posts: 2074
Location: Brisbane, Queensland

i need a bit of help getting the ?blah= command working
system
--
Khel
Posts: 551
Location: Brisbane, Queensland

As in how to read things back from the querystring or how to put things in there?
WarT
Posts: 2076
Location: Brisbane, Queensland

i wanna know how to read the bit after that and pass it through to the code
klayman
Posts: 121
Location: Brisbane, Queensland

php.
WarT
Posts: 2077
Location: Brisbane, Queensland

no asp cause i don't wanna do php
Khel
Posts: 554
Location: Brisbane, Queensland

In ASP you use the Request.QueryString collection to access arguments in the querystring (the bits after the ?)

Say the url was http://www.blah.com/default.asp?Test1=blah&Test2=blah

You could access the value of test1 by doing something along the lines of

SomeVariable = Request.QueryString("Test1")

WarT
Posts: 2078
Location: Brisbane, Queensland

cool ta i couldn't remember
WarT
Posts: 2079
Location: Brisbane, Queensland

still having problems can you icq me plz khel
Khel
Posts: 556
Location: Brisbane, Queensland

No icq access where I am atm...
WarT
Posts: 2080
Location: Brisbane, Queensland

s*** s*** s*** s*** s*** s*** s*** s*** s*** s***
WarT
Posts: 2081
Location: Brisbane, Queensland

ok what i want is
its retail.asp?product=whatver
nmy variable is thingo (great names yes)
i want
select * from thingo to happen
can you help me with that?
Khel
Posts: 557
Location: Brisbane, Queensland

What are you using for your db access, ADO?

The general way to do something like that is to get the variable from the querystring, create the sql query in a string, then pass that string to the execute or open method of your recordset. Using ADO and VBScript it would be something like this.

dim SqlQry
dim rs

thingo = Request.QueryString("product")
SqlQry = "SELECT * FROM " & thingo
Set rs = CreateObject("adodb.Recordset")
rs.Open SqlQry, dbConn


dbConn is a reference to a database connection object that you should have already opened previously. If you aren't using ADO that exact syntax wont work, but thats the basic idea behind it :)
WarT
Posts: 2082
Location: Brisbane, Queensland

its a dsn-less connection no ado
WarT
Posts: 2084
Location: Brisbane, Queensland

good stuff man i only needed one line outta that code you wrote and it worked
thanks :P
sKryBe
Posts: 9
Location: Brisbane, Queensland

FYI there's some really good ASP help sites out there on the Web. I use ASP 101, ASP Toolbox, The ASP Resource Index and good ole' Microsoft's ASP reference. And if I have questions The FAQTS Knowledge Base is pretty handy too.

Enjoy.
sKryBe
Posts: 10
Location: Brisbane, Queensland

Oops I stuffed up the Microsoft link. It should be http://msdn.microsoft.com/workshop/server/asp/ASPover.asp
WarT
Posts: 2086
Location: Brisbane, Queensland

yeah i know but this site is a pain in the ass
brinkster
system
--
Not a new post since your last visit.
New Post Since your last visit
Back To Forum
Advertise with Us | Privacy Policy | Contact Us
© Copyright 2001-2026 AusGamers Pty Ltd. ACN 093 772 242.
Hosted by Mammoth Networks - Australian VPS Hosting
Web development by Mammoth Media.