Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help adding fields to this "Check User Name" script in DW4

Status
Not open for further replies.

TonyU

Technical User
Feb 14, 2001
1,317
US
[tt]
Ok guys, here's what I've been breaking my head on all day today and can't figure it out.

I'm going to try to use this approach because everything else has failed, and you tell me if you think it will work or not.

Using DW4, I have added this server behavior to my page where I can check if a user name already exists in my database, I'm using the same IDEA and applied to a Start Date Field with me so far? cool.

What I'm trying to do now is add the other 2 fields (the EndDate Field and DATE fields) and checking all three fieldsto the check username behavior


<%
' *** Redirect if username exists
MM_flag=&quot;MM_insert&quot;
If (CStr(Request(MM_flag)) <> &quot;&quot;) Then
MM_dupKeyRedirect=&quot;goback.asp&quot;
MM_rsKeyConnection=MM_conferenceroom_STRING
MM_dupKeyUsernameValue = CStr(Request.Form(&quot;starttime&quot;))
MM_dupKeySQL=&quot;SELECT starttime FROM Requests WHERE starttime='&quot; & MM_dupKeyUsernameValue & &quot;'&quot;
MM_adodbRecordset=&quot;ADODB.Recordset&quot;
set MM_rsKey=Server.CreateObject(MM_adodbRecordset)
MM_rsKey.ActiveConnection=MM_rsKeyConnection
MM_rsKey.Source=MM_dupKeySQL
MM_rsKey.CursorType=0
MM_rsKey.CursorLocation=2
MM_rsKey.LockType=3
MM_rsKey.Open
If Not MM_rsKey.EOF Or Not MM_rsKey.BOF Then
' the username was found - can not add the requested username
MM_qsChar = &quot;?&quot;
If (InStr(1,MM_dupKeyRedirect,&quot;?&quot;) >= 1) Then MM_qsChar = &quot;&&quot;
MM_dupKeyRedirect = MM_dupKeyRedirect & MM_qsChar & &quot;requsername=&quot; & MM_dupKeyUsernameValue
Response.Redirect(MM_dupKeyRedirect)
End If
MM_rsKey.Close
End If
%>
<%

<%=Tony%>
banana.gif
rockband.gif
banana.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top