append on asp page - need help!!!

Results 1 to 2 of 2

Thread: append on asp page - need help!!!

  1. #1
    Join Date
    Dec 1969

    Default append on asp page - need help!!!

    I am writting an insert stored procedure in mssql.<BR>It will be / or should be (it is a medical form) about 150 fields of which at least 100 are required.<BR>So the user will be inputting all required fields ( plus those which are not required, if necessary)<BR>So I was thinking if there is a way instead of writing 100-150 APPEND statements on asp page to LOOP them?<BR>Thanks,<BR>Rudi<BR>The below code I would have on my asp page.<BR>&#060;%<BR>set dataConn = Server.CreateObject("ADODB.Connection")<BR>dataCon n.Open "DSN=webData;uid=user;pwd=password"<BR>Set adocmd = Server.CreateObject("ADODB.Command")<BR>adocmd.Com mandText = "sp_MyProc"<BR>adocmd.ActiveConnection = dataConn<BR>adocmd.CommandType = adCmdStoredProc<BR>adocmd.Parameters.Append adocmd.CreateParameter<BR>("username",adVarChar, adParamInput, 16, _<BR>Request.Form("UserName"))<BR>.........<BR>ado cmd.Execute<BR>%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: append on asp page - need help!!!

    Hello,<BR><BR>Maybe this can work :<BR><BR>Loop through all form elements using<BR>for each i in request.form<BR> adocmd.Parameters.Append adocmd.CreateParameter (i,adVarChar, adParamInput, 16, Request.Form(i))<BR>next<BR><BR>Checking the required fields can be done by naming them (field starts with "A" if it&#039s needed) and just count the ones that start with an "A" and check the sum.<BR><BR>Hope this helps,<BR>Peter<BR>[]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts