UserAction.cfm

2000-08-29 Thread Jeremy Toevs

When you have a "No Duplicates" field in the database and a duplicate is entered, CF 
returns somewhat of a weird error message. How do you get it to return an error 
message saying "This UserName is already in use, choose another." UserName being the 
"No Duplicates" field. Here is my action cfm:

*

cfquery datasource="DSN" name="AddUser"
INSERT INTO Users (UserName, RealName, Email)
VALUES ('#UserName#','#RealName#','#Email#')
/cfquery

*

Thanks in advance,

Jeremy

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: UserAction.cfm

2000-08-29 Thread Kelly Matthews

What i normally do is FIRST I RUN a QUERY against the database
seeing if the USERNAME that was passed is equal to any username in the 
database. Then i do a CFIF query.recordcount GT "1"
and show a message that the username is taken and then a CFELSE
that does the insert. That way if the query comes back with at least
ONE record you know the user id is taken if it comes back with ZERO
you do the insert.
Kelly

Stay current with what's happening on AirportNet. Subscribe to our 
Announcement list today: http://www.airportnet.org/email.htm

---
Kelly Matthews
Internet Development Coordinator
AAAE
703.578.2509
[EMAIL PROTECTED]
http://www.airportnet.org
---

 -Original Message-
 From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, August 29, 2000 11:49 AM
 To:   
 Subject:  UserAction.cfm
 
 When you have a "No Duplicates" field in the database and a duplicate is
 entered, CF returns somewhat of a weird error message. How do you get it
 to return an error message saying "This UserName is already in use, choose
 another." UserName being the "No Duplicates" field. Here is my action cfm:
 
 *
 
 cfquery datasource="DSN" name="AddUser"
 INSERT INTO Users (UserName, RealName, Email)
 VALUES ('#UserName#','#RealName#','#Email#')
 /cfquery
 
 *
 
 Thanks in advance,
 
 Jeremy
 
 --
 
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: UserAction.cfm

2000-08-29 Thread Jeremy Toevs

How would that query look?

 Kelly Matthews [EMAIL PROTECTED] 08/29/00 08:43AM 
What i normally do is FIRST I RUN a QUERY against the database
seeing if the USERNAME that was passed is equal to any username in the 
database. Then i do a CFIF query.recordcount GT "1"
and show a message that the username is taken and then a CFELSE
that does the insert. That way if the query comes back with at least
ONE record you know the user id is taken if it comes back with ZERO
you do the insert.
Kelly

Stay current with what's happening on AirportNet. Subscribe to our 
Announcement list today: http://www.airportnet.org/email.htm 

---
Kelly Matthews
Internet Development Coordinator
AAAE
703.578.2509
[EMAIL PROTECTED] 
http://www.airportnet.org 
---

 -Original Message-
 From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]] 
 Sent: Tuesday, August 29, 2000 11:49 AM
 To:   
 Subject:  UserAction.cfm
 
 When you have a "No Duplicates" field in the database and a duplicate is
 entered, CF returns somewhat of a weird error message. How do you get it
 to return an error message saying "This UserName is already in use, choose
 another." UserName being the "No Duplicates" field. Here is my action cfm:
 
 *
 
 cfquery datasource="DSN" name="AddUser"
 INSERT INTO Users (UserName, RealName, Email)
 VALUES ('#UserName#','#RealName#','#Email#')
 /cfquery
 
 *
 
 Thanks in advance,
 
 Jeremy
 
 --
 
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRstsbodyRsts/cf_talk or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: UserAction.cfm

2000-08-29 Thread Kelly Matthews

Example:
CFQUERY datasource="#DSN#" name="auth"
SELECT * 
FROM PenPals
WHERE PP_Username = '#Form.PP_Username#'
/CFQUERY
CFIF auth.recordcount GT "0"
I'm sorry someone has already chosen that username, please go back
and choose another.
CFELSE
CFINSERT dataSource="#dsn#" tableName="PenPals"
/CFIF

Stay current with what's happening on AirportNet. Subscribe to our 
Announcement list today: http://www.airportnet.org/email.htm

---
Kelly Matthews
Internet Development Coordinator
AAAE
703.578.2509
[EMAIL PROTECTED]
http://www.airportnet.org
---

 -Original Message-
 From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, August 29, 2000 12:02 PM
 To:   [EMAIL PROTECTED]
 Subject:  RE: UserAction.cfm
 
 How would that query look?
 
  Kelly Matthews [EMAIL PROTECTED] 08/29/00 08:43AM 
 What i normally do is FIRST I RUN a QUERY against the database
 seeing if the USERNAME that was passed is equal to any username in the 
 database. Then i do a CFIF query.recordcount GT "1"
 and show a message that the username is taken and then a CFELSE
 that does the insert. That way if the query comes back with at least
 ONE record you know the user id is taken if it comes back with ZERO
 you do the insert.
 Kelly
 
 Stay current with what's happening on AirportNet. Subscribe to our 
 Announcement list today: http://www.airportnet.org/email.htm 
 
 ---
 Kelly Matthews
 Internet Development Coordinator
 AAAE
 703.578.2509
 [EMAIL PROTECTED] 
 http://www.airportnet.org 
 ---
 
  -Original Message-
  From:   Jeremy Toevs [SMTP:[EMAIL PROTECTED]] 
  Sent:   Tuesday, August 29, 2000 11:49 AM
  To: 
  Subject:UserAction.cfm
  
  When you have a "No Duplicates" field in the database and a duplicate is
  entered, CF returns somewhat of a weird error message. How do you get it
  to return an error message saying "This UserName is already in use,
 choose
  another." UserName being the "No Duplicates" field. Here is my action
 cfm:
  
  *
  
  cfquery datasource="DSN" name="AddUser"
  INSERT INTO Users (UserName, RealName, Email)
  VALUES ('#UserName#','#RealName#','#Email#')
  /cfquery
  
  *
  
  Thanks in advance,
  
  Jeremy
  
 
 --
  
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
  To Unsubscribe visit
  http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
 or
  send a message to [EMAIL PROTECTED] with 'unsubscribe'
 in
  the body.
 --
 
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
 
 --
 
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



Re: UserAction.cfm

2000-08-29 Thread JustinMacCarthy


Like this:

cftransaction

cfquery datasource="DSN" name="CHKuser"
SELECT * FROM WHERE UserName = '#UserName#'
/cfquery


cfif not (CHKuser.Reocrdcount)
cfquery datasource="DSN" name="AddUser"

INSERT INTO Users
(UserName, RealName,  Email)
VALUES ('#UserName#','#RealName#','#Email#')

/cfquery

cfelse

User name exists
cfabort

/cfif


/cftransaction

but I still like the


cftrycfcatch type=database  :-)


~Justin MacCarthy


- Original Message -
From: "Jeremy Toevs" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, August 29, 2000 5:01 PM
Subject: RE: UserAction.cfm


 How would that query look?

  Kelly Matthews [EMAIL PROTECTED] 08/29/00 08:43AM 
 What i normally do is FIRST I RUN a QUERY against the database
 seeing if the USERNAME that was passed is equal to any username in the
 database. Then i do a CFIF query.recordcount GT "1"
 and show a message that the username is taken and then a CFELSE
 that does the insert. That way if the query comes back with at least
 ONE record you know the user id is taken if it comes back with ZERO
 you do the insert.
 Kelly

 Stay current with what's happening on AirportNet. Subscribe to our
 Announcement list today: http://www.airportnet.org/email.htm

 ---
 Kelly Matthews
 Internet Development Coordinator
 AAAE
 703.578.2509
 [EMAIL PROTECTED]
 http://www.airportnet.org
 ---

  -Original Message-
  From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]]
  Sent: Tuesday, August 29, 2000 11:49 AM
  To: 
  Subject: UserAction.cfm
 
  When you have a "No Duplicates" field in the database and a duplicate is
  entered, CF returns somewhat of a weird error message. How do you get it
  to return an error message saying "This UserName is already in use,
choose
  another." UserName being the "No Duplicates" field. Here is my action
cfm:
 
  *
 
  cfquery datasource="DSN" name="AddUser"
  INSERT INTO Users (UserName, RealName, Email)
  VALUES ('#UserName#','#RealName#','#Email#')
  /cfquery
 
  *
 
  Thanks in advance,
 
  Jeremy
 

 --
  
  Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
  To Unsubscribe visit
  http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk
or
  send a message to [EMAIL PROTECTED] with 'unsubscribe'
in
  the body.
 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

 --

 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar



--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



RE: UserAction.cfm

2000-08-29 Thread Byron Stuart

cfquery datasource="DSN" name="CheckUserName"
Select UserName
From Users
Where UserName = '#UserName#'
/cfquery

cfif CheckUserName.RecordCount EQ "0"
  cfquery datasource="DSN" name="AddUser"
  INSERT INTO Users (UserName, RealName, Email)
  VALUES ('#UserName#','#RealName#','#Email#')
  /cfquery
/cfif



Byron

-Original Message-
From: Jeremy Toevs [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 29, 2000 9:02 AM
To: [EMAIL PROTECTED]
Subject: RE: UserAction.cfm


How would that query look?

 Kelly Matthews [EMAIL PROTECTED] 08/29/00 08:43AM 
What i normally do is FIRST I RUN a QUERY against the database
seeing if the USERNAME that was passed is equal to any username in the 
database. Then i do a CFIF query.recordcount GT "1"
and show a message that the username is taken and then a CFELSE
that does the insert. That way if the query comes back with at least
ONE record you know the user id is taken if it comes back with ZERO
you do the insert.
Kelly

Stay current with what's happening on AirportNet. Subscribe to our 
Announcement list today: http://www.airportnet.org/email.htm 

---
Kelly Matthews
Internet Development Coordinator
AAAE
703.578.2509
[EMAIL PROTECTED] 
http://www.airportnet.org 
---

 -Original Message-
 From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]] 
 Sent: Tuesday, August 29, 2000 11:49 AM
 To:   
 Subject:  UserAction.cfm
 
 When you have a "No Duplicates" field in the database and a duplicate is
 entered, CF returns somewhat of a weird error message. How do you get it
 to return an error message saying "This UserName is already in use, choose
 another." UserName being the "No Duplicates" field. Here is my action cfm:
 
 *
 
 cfquery datasource="DSN" name="AddUser"
 INSERT INTO Users (UserName, RealName, Email)
 VALUES ('#UserName#','#RealName#','#Email#')
 /cfquery
 
 *
 
 Thanks in advance,
 
 Jeremy
 
 --
 
 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
 To Unsubscribe visit
 http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
 send a message to [EMAIL PROTECTED] with 'unsubscribe' in
 the body.

--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ 
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.


--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
--
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.