Hi everyone. I'm currently a CIS student working on a project for my final class. I'm developing a website using .asp and am having difficulty with a certain page on my site. This page handles retrieving product information from my database and posting it. This is the code I am using currently and it works fine but its basically a scale down version of what I want it to do.

' Get the Product ID
productID = TRIM( Request( "pid" ) )

' Get product category
category = TRIM( Request("cat") )

' Open the Database Connection
Set Con = Server.CreateObject( "ADODB.Connection" )

' Get the Product Information
sqlString = "SELECT * FROM Product "
sqlString = sqlString & "WHERE product_id=" & productID
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
RS.Open sqlString

' Get Current Category
cat = RS( "product_type" )

The area I am having issue with is in Getting the product information. What I am trying to do is get product information off of the product table and other tables that would correspond to the product_type(category) . Currently the Product types are Book, DVD, Game.

What I think I should do is use an IF statment here like this
IF cat = 1
select ___, ___, __
from product join dvd __
IF cat = 2
select __, __, __
from ____ ___ __

First off is this the right approach to solving this issue? Second and the part that I am stuck on is how I would implement this. What I mean by this is Im not sure how exactly to code this in asp. Particularly how I would reference what Category is being selected.

Thanks in advance for any and all pointers

I know these forums usually have set procedures in posting code etiquette, excuse me if I posted this incorrectly.