Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 query field y/n and redirect

Author  Topic 

dlbdennis
Starting Member

1 Post

Posted - 2003-06-03 : 17:24:44
I'm looking for some help on this.
I use an Access database the holds userid. I have a field that I called fldNews Y/N is the type. I need to query this field. One way should redirect to news.asp and the other should redirect to searchform.asp

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-06-03 : 18:46:58
You haven't given enough information yet for us to help. BTW, this forum is for SQL Server, so you'll want to post your question in the Access forum.

For us to help, we would need to see the DDL of the table. Also, is your question about the SQL statement or about ASP?

Tara
Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-06-03 : 22:27:47
select fldNews
from [table]
where userid = 123

You need to use ADO, create a command object. You could use output parameters or return a recordset.

I suggest putting your sql in stored procedures.

If you use output parameters you can only access them once the recordset is closed.

If you use a command object then you do

If (outputparameter) = -1 Then
Response.Redirect "news.asp"
Else
Response.Redirect "searchform.asp"
End If


Here is some reading material to help you out.
http://www.w3schools.com/ado/default.asp
http://www.w3schools.com/ado/ado_ref_command.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsqlpro01/html/sql01b1.asp
http://www.sqlteam.com/item.asp?ItemID=2755
http://www.sqlteam.com/item.asp?ItemID=2644
http://www.sqlteam.com/item.asp?ItemID=6948



Go to Top of Page
   

- Advertisement -