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.


 Subscribe in a reader

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

Notices




Closed Thread
 
LinkBack Thread Tools
  #1  
Old Jul 26th, 2004, 04:22
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Jul 27th, 2004, 05:19
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
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)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old Jul 29th, 2004, 16:30
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #7  
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #8  
Old Jul 31st, 2004, 18:47
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
thx for the addvice, but can I make 2 different types of users go to 2 different pages after logging in?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #9  
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #10  
Old Aug 2nd, 2004, 17:10
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
thx that worked! I needed that advice! Now do you know how to make a game like cartoonorbit?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #11  
Old Aug 2nd, 2004, 17:17
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Also after then login can you make them view a page for like 5 seconds then be redircted to the real page?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #12  
Old Aug 2nd, 2004, 18:14
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
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.
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #13  
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #14  
Old Aug 3rd, 2004, 10:36
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,186
Blog Entries: 7
Thanks: 27
Thanked 23 Times in 20 Posts
:wink:
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #15  
Old Aug 3rd, 2004, 18:02
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
thx! Also I need to know how to make a game could anyone help or knows a website that would help?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #16  
Old Aug 3rd, 2004, 18:08
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
could you explain that script a little more plz?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #17  
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #18  
Old Aug 3rd, 2004, 19:10
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
I need to know the software the best software for free and paid software and A little bit or programming!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #19  
Old Aug 3rd, 2004, 19:13
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #20  
Old Aug 6th, 2004, 19:06
Up'n'Coming Member
Join Date: Jul 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Wow will anyone reply to my question?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
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