%@ Language=VBScript %> <% dim strErr strErr = "initial" if Request.Form("sltFall.selectedIndex") = -1 then strErr = "Please select when your Fall season begins." if Request.Form("sltOrg.selectedIndex") = -1 then strErr = "Please select an Organization Role." end if if Request.Form("sltSpring.selectedIndex") = -1 then strErr = "Please select when your Spring season begins." end if if len(Request.Form("txtNbrPlayers")) = 0 then strErr = "Please enter the number of players in your organization." end if if len(Request.Form("txtOrg")) = 0 then strErr = "Please enter an Organization." end if if len(Request.Form("txtEMail")) = 0 then strErr = "Please enter an E-Mail Address." end if if len(Request.Form("txtPhone")) = 0 then strErr = "Please enter a Phone Number." end if if len(Request.Form("txtZip")) = 0 then strErr = "Please enter a Zip Code." end if end if if len(Request.Form("txtState")) = 0 then strErr = "Please enter a State." end if if len(Request.Form("txtCity")) = 0 then strErr = "Please enter a City." end if if len(Request.Form("txtAddr1")) = 0 then strErr = "Please enter an Address." end if if len(Request.Form("txtLName")) = 0 then strErr = "Please enter a Last Name." end if if len(Request.Form("txtFName")) = 0 then strErr = "Please enter a First Name." end if If strErr = "initial" then dim objRS, objConn, strConn, strSQL set objConn = Server.CreateObject("ADODB.Connection") 'Connection string for SQL Server 7.0 or 2000 ' strConn = "Provider='sqloledb';Data Source='PSCVG240';Initial Catalog='KYR';User Id=sa;Password=;" sConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" sMapPath = Server.MapPath("\") sMapPath = Mid(sMapPath, 1, InStrRev(sMapPath,"\")-1) & "\database\DB-NAME.mdb;Persist Security Info=False;" sConnString = sConnString & sMapPath strConn = "DRIVER=SQL Server; SERVER=premsql2a.brinkster.com; UID=jgordos; PWD=godzilla; Network Library=dbmssocn;" objConn.open strconN set objRS = Server.CreateObject("ADODB.Recordset") 'Two sql statements strSQL = "SELECT userid FROM UserRegistration WHERE userid LIKE '" & Request.Form("txtuserid") & "';" addSQL = "INSERT INTO UserRegistration( usertitle, userfname, userlname,useraddr1, useraddr2, usercity, userstate, userzip, userphone, useremailaddr, userorg, userorgrole,usernbrplayers, userspringseason, userfallseason, reg_date) Values('" & _ Request.Form("sltTitle") & "', '" & _ request.Form("txtfname") & "', '" & request.Form("txtlname") & "', '" & request.Form("txtaddr1") & "', '" & _ request.Form("txtaddr2") & "', '" & request.Form("txtcity") & "', '" & request.Form("txtstate") & "', '" & _ request.Form("txtzip") & "', '" & request.Form("txtphone") & "', '" & request.Form("txtemail") & "', '" & _ request.Form("txtorg") & "', '" & request.Form("sltOrgRole") & "', '" & request.Form("txtnbrplayers") & "', '" & _ request.Form("sltspring") & "', '" & request.Form("sltfall") & "', '" & now() & "')" 'Check to see if any users exist set objRS = objConn.execute(strSQL) 'If the sql statement is empty 'The user gets added If objRS.eof Then objConn.execute(addSQL) strErr = "Your registration has processed successfully." Response.Redirect "download_sample.htm" else strErr = "The User ID you entered already exists. Please re-enter another User ID. Please use the Back button to return to your registration page." end if 'Close and destroy all objects objRS.close set objRS = nothing objConn.close Set objConn = nothing end if %>
|
© 2003
KnowYourRules, LLC. All Rights Reserved.
Read our Privacy Statement, Legal Notices, and Return Policy |