 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 23rd, 2004, 11:14 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
checking fields value from rs
I have this rsCustomer executing on a page, and I want to find an easyway of checking if any of the fields are empty or Null. at the moment I am using If IsNull(rsCustomer("fieldname)) then but there must be a better way, cause I want to redirect them to update profile page.
any good ideeas?
|
|

July 23rd, 2004, 05:57 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
I am not sure I understand the problem. What does the IsNull have to do with a Redirect statement? What can't you redirect when the column IsNull (or isn't) and why do you need a better alternative for IsNull?
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 24th, 2004, 01:57 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the database has been on the server for more than 3 years.
the entire website is getting redone and more than 10 new fields has been added to the customer table.
if a customer comes back to the website, all the new fileds added have empty value, so i need to redirect them to the update details page. As I said I could do it by checking the field for null value, but i thought is a cleaner way of doing it, instead typing 20 lines of code.
|
|

July 24th, 2004, 02:03 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Well, I don't think so. You have to check out whether the field contains Null to find out whether it contains null ;)
Instead of 10 redirect statements, you could query the database for the null fields. Something like this:
SELECT Count(ID) FROM Customer WHERE Field1 = Null OR Field2= Null WHERE Customer.ID = 1234
If this query returns a record, some of the new fields was null so you need to redirect.
Does this help?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

July 24th, 2004, 02:23 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No, that's not good, as i don't want to query the database again. all fields are already filter and written to the browser, so another call to the database is out of discussion.
i'll stick to my statement:
if IsNull(rsCustomer("LastName")) or IsNull(rsCustomer("FirstName")or...and so on... then
response.redirect("updatepage.asp")
Thanks anyway.
|
|
 |