Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP and databse

Status
Not open for further replies.

jdm3

Programmer
Sep 8, 2003
20
CA
after I have created a database, as followed Table products.mdb

I have the product category displaying fine and the search works fine also,
here is what I have, I want to include the search to perform a defined search, but don't know how to include other tables that are already existing in the products.mdb such as,

TblCountyID
ProvinceID
TblCityID

This is what I need to add below so that when we select Canada in a dropdown lost then selcting, a Province and then a City, So that after the search you are only retreiving the required fields. I can sure use some help on this.


Default.asp:

<!-- #INCLUDE FILE=&quot;adovbs.inc&quot; -->
<%
' Get Current Category
cat = TRIM( Request( &quot;cat&quot; ) )
IF cat = &quot;&quot; THEN cat = &quot;Home&quot;

' Get Search Phrase
searchFor = TRIM( Request( &quot;searchFor&quot; ) )


' Get Current Category
cat = TRIM( Request( &quot;cat&quot; ) )
IF cat = &quot;&quot; THEN cat = &quot;Home&quot;

' Open Database Connection
Set Con = Server.CreateObject( &quot;ADODB.Connection&quot; )
Con.Open &quot;accessDSN&quot;
' Open Recordset with Static Cursor
Set RS = Server.CreateObject( &quot;ADODB.Recordset&quot; )
RS.CursorType = adOpenStatic
RS.ActiveConnection = Con
RS.Open &quot;Select * FROM Products&quot;
' Display Count of Products
Response.Write &quot;Number of products: &quot;
Response.Write RS.RecordCount
%>
 
I'm not real clear on this. Are you asking how to join tables in a SQL statement?
 
Yes I am looking for how I would write the asp codes
 
Here are some SQL tutorial links:


You can also open your version of MSAccess and go to the Help Index. Type in &quot;Join&quot; and it will give you several examples.

The coding of the SQL statements for joins wouldn't be any different from what you already have &quot;Select * From Products&quot;. The thing that would be different is the actual SQL statement.
 
Yeah But that reading does not get me off the ground, all I am looking for the position and codes for the statement I made above, could someone please look at this and tell me what I need to change in these codes to make my search to include dropdowns, with CountryID and CityID

I have the product category displaying fine and the search works fine also,
here is what I have, I want to include the search to perform a defined search, but don't know how to include other tables that are already existing in the products.mdb such as,

TblCountyID
ProvinceID
TblCityID

This is what I need to add below so that when we select Canada in a dropdown lost then selcting, a Province and then a City, So that after the search you are only retreiving the required fields. I can sure use some help on this.


Default.asp:

<!-- #INCLUDE FILE=&quot;adovbs.inc&quot; -->
<%
' Get Current Category
cat = TRIM( Request( &quot;cat&quot; ) )
IF cat = &quot;&quot; THEN cat = &quot;Home&quot;

' Get Search Phrase
searchFor = TRIM( Request( &quot;searchFor&quot; ) )


' Get Current Category
cat = TRIM( Request( &quot;cat&quot; ) )
IF cat = &quot;&quot; THEN cat = &quot;Home&quot;

' Open Database Connection
Set Con = Server.CreateObject( &quot;ADODB.Connection&quot; )
Con.Open &quot;accessDSN&quot;
' Open Recordset with Static Cursor
Set RS = Server.CreateObject( &quot;ADODB.Recordset&quot; )
RS.CursorType = adOpenStatic
RS.ActiveConnection = Con
RS.Open &quot;Select * FROM Products&quot;
' Display Count of Products
Response.Write &quot;Number of products: &quot;
Response.Write RS.RecordCount
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top