search function in ASP!

This is a discussion on "search function in ASP!" within the Classic ASP section. This forum, and the thread "search function in ASP! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 26th, 2004, 04:22
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
search function in ASP!

is if posible to do a search function in ASP that can search not just in one database, but it can preview a search result in 2 or 3 database!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)

  #2 (permalink)  
Old Jul 26th, 2004, 08:38
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Yes of course, just connect and select from each different database on the same page.
  #3 (permalink)  
Old Jul 27th, 2004, 05:19
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
well..i am not good in coding! i am using MACROMEDIA ULTRADEV 4 to develop my site. as far as i know, each page will be allowed to connect to only one database! maybe some adjustment could be done in the sql command?
if you familiar with that software, could you teach me how?
thanx...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
  #4 (permalink)  
Old Jul 27th, 2004, 08:48
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Do you want to select data from different databases or just different database tables?
  #5 (permalink)  
Old Jul 27th, 2004, 12:31
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
If it's from different tables and the same database, then you type in your connection at the top of your page FE-
Code: Select all
<% Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout=60
connectionToDatabase.Open "DSN=Mydatabase"%>
Now if your not using a DSN use your regular physical path here...
Then all you have to do is Type in your queries from each of the tables.
Code: Select all
<%
Set recordSet =Server.CreateObject("ADODB.Recordset")
recordSet.Open "SELECT * FROM TableName" ,connectionToDatabase, 1,2
Do While Not recordSet.EOF
	Response.Write(recordSet("Whatever"))
	recordSet.MoveNext
Loop
%>
Then you can just keep on going with your next one. Make sure though that you do not close your connection to the database until you query the last table in it.


Now if your connecting to multiple databases...

Set your connection to the database.
Code: Select all
<% Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout=60
connectionToDatabase.Open "DSN=Mydatabase"%>
Use your tables...
Code: Select all
<%
Set recordSet =Server.CreateObject("ADODB.Recordset")
recordSet.Open "SELECT * FROM TableName" ,connectionToDatabase, 1,2
Do While Not recordSet.EOF
	Response.Write(recordSet("Whatever"))
	recordSet.MoveNext
Loop
%>
Then close the connection...
Code: Select all
<% connectionToDatabase.Close
Set connectionToDatabase=Nothing
%>
Now you can Connect to your next database and start from there.
Code: Select all
<% Set connectionToDatabase=Server.CreateObject("ADODB.Connection")
connectionToDatabase.ConnectionTimeout=60
connectionToDatabase.Open "DSN=Mydatabase2"%>
And then just repeat the above and that'll get ya going. Now Im stil New to ASP , but that's how I do it. It works and it seems fine to me. I haven't had any problems with it so far.
  #6 (permalink)  
Old Jul 29th, 2004, 16:30
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
hey is it possible to have different go to different pages when they login on my asp site I need a code that tells me how to do that? Like for instants, lets say a person with a free account logins in and goes to the free account page right after they login! well can I make a person with a paid account go to a paid account page after logging in?
  #7 (permalink)  
Old Jul 29th, 2004, 18:35
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
You can either do that or store things in their database. For Instance....
Code: Select all
<%
dim var
var = recordSet("Paid")

If var = "" Then
Response.Write("Blah Blah Blah")
Else 
  Response.Write("Howdy, welcome to the paid portion")
End If
%>
Where you can basically put your two pages in one and just let the user see the one that corresponds to him/her. Just make sure you connect to your database first :wink:.

Ohh yeah, you can also use the Response.Redirect tag if you would rather keep them as seperate pages. It's up to you.
  #8 (permalink)  
Old Jul 31st, 2004, 18:47
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
thx for the addvice, but can I make 2 different types of users go to 2 different pages after logging in?
  #9 (permalink)  
Old Jul 31st, 2004, 21:25
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah, you can do this the coded way, or take a shorter way, but it adds a page.. I'd use the shorter version.. it's much faster IMO.

Code: Select all
<%
dim UserX
UserX = recordSet("UserType")

If UserX = "1" Then
      Response.Redirect("PageForThem.asp")
   Else
      Response.Redirect("PageForOthers.asp")
End If
%>
That will do it for you. This is the shorter way of doing it (code wise). Hope that helps.
  #10 (permalink)  
Old Aug 2nd, 2004, 17:10
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
thx that worked! I needed that advice! Now do you know how to make a game like cartoonorbit?
  #11 (permalink)  
Old Aug 2nd, 2004, 17:17
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
Also after then login can you make them view a page for like 5 seconds then be redircted to the real page?
  #12 (permalink)  
Old Aug 2nd, 2004, 18:14
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
use this code:-
Code: Select all
<META HTTP-EQUIV="refresh"
content="5; URL=http://the URL of the second page">
That gives you a 5 second delay. It needs to be placed in the <head> section.
Use ASP to substitute the URL part of the above for the right page.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #13 (permalink)  
Old Aug 3rd, 2004, 07:59
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Rob you need to edit that post mate!
  #14 (permalink)  
Old Aug 3rd, 2004, 10:36
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
:wink:
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #15 (permalink)  
Old Aug 3rd, 2004, 18:02
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
thx! Also I need to know how to make a game could anyone help or knows a website that would help?
  #16 (permalink)  
Old Aug 3rd, 2004, 18:08
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
could you explain that script a little more plz?
  #17 (permalink)  
Old Aug 3rd, 2004, 18:27
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
what do you need to know about making a game? Do you need to know the programming? The software? The way to store information to a database? The way to transfer Variables from Flash to ASP? How to make something move on button press? plz be more specific. Thanks.
  #18 (permalink)  
Old Aug 3rd, 2004, 19:10
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
I need to know the software the best software for free and paid software and A little bit or programming!
  #19 (permalink)  
Old Aug 3rd, 2004, 19:13
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
hey also can I make a person with a paid account go to a regular page but then be able to come back to all the paid account pages? I mean like, make the website site check his account type and redirect him to specific pages?
  #20 (permalink)  
Old Aug 6th, 2004, 19:06
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Amari
Wow will anyone reply to my question?
Closed Thread

Tags
search, function, asp

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Is this a suitable 'search CSV' function? Aso PHP Forum 8 Dec 18th, 2007 15:19
Search Analyst/Account Executive/SEO/PPC/CPC/Search Engine Optimisation/Pay per Click/London Web JobBot Job Opportunities 0 Nov 22nd, 2006 10:20
SEO/PPC/Search Engine Optimisation/Pay Per Click/Campaigns/Online/Marketing/Agency/Analyst/Search/Manager/Executive/Manchester Web JobBot Job Opportunities 0 Nov 17th, 2006 11:11
Adding a search function bob_visualefx Web Page Design 10 Apr 17th, 2006 12:25
criteria search function akdiver Other Programming Languages 2 Aug 27th, 2005 00:10


All times are GMT. The time now is 06:13.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43