Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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
 
Old February 6th, 2004, 06:06 PM
Authorized User
 
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validate ID

I need a function that when a user enters in a Value like an Id the function check the database if there is already an existing ID. If so returns a message to the user. Anyone have any source code for this.





 
Old February 8th, 2004, 09:17 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

try something like :

set results=dbConn.execute("SELECT * FROM users WHERE user_id='" & Request.Form("userid") & "'")

if results.EOF
    'no match
else
    ' 1 or more matches
end if
 
Old February 9th, 2004, 08:05 PM
Authorized User
 
Join Date: Jan 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<%
Dim LPCommand1
Dim adExecuteNoRecords
Dim IngAdded
Dim IngRecs
Dim ingexist


Set LPCommand1 = Server.CreateObject("ADODB.Command")
    With LPCommand1
         .ActiveConnection = conn
         .CommandText = "PANVLP_CodFabCheck"
         .CommandType = adCmdStoredProc
        
            'Create the parameters
            .Parameters.Append .CreateParameter ("RETURN_VALUE", adInteger, adParamReturnValue)
            .Parameters.Append .CreateParameter ("@Ps_CodFab", advarchar, adParamInput, 30, Request.Form("Ps_CodFab"))

            'Execute Stored Procedure
            .Execute IngRecs, ,adExecuteNoRecords
            ingexist = .Parameters("RETURN_VALUE")


    end with
Set LPCommand1 = nothing

Is there a way i can throw ingexist into some java function to fire the alert??? Or better yet for the java function to call this sp. You see I am using a submit button to post to another page that will do the processing I the the onsubmit it calls a java function that validates other things like empty fields and stuff I want it also to do this check. I know this is probaly simple for you gurus, but i am an asp novie.





Similar Threads
Thread Thread Starter Forum Replies Last Post
'this.ID = id;' in class construction holf BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 October 6th, 2006 10:58 AM
how can i validate the following using a message noor JSP Basics 0 May 14th, 2005 02:24 AM
why not index.asp?id=1 can be www.myweb.com/?id=1 BurhanKhan Classic ASP Professional 11 September 6th, 2004 02:06 PM
How to validate a node in C++ ThunderBird XML 2 August 27th, 2004 11:22 AM
validate textbox stoneman Access 5 January 30th, 2004 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.