asp related queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickyspace
    New Member
    • Mar 2008
    • 14

    asp related queries

    hi

    i have issue regarding asp code.
    clubname1,clubn ame2,clubname3 is string value which is successfully send from one page to another . but when this page gets value to the above mention variable , data doesn't get insert to mssql database. it send null value. but when i do response.write( ).
    eg : response.write (clubname1) i get the value whatever user inputs . but while inserting data into ms sql 2000 it insert null value.

    please anybody help me regarding this code . and also tell me where am i doing wrong.
    below is the code.

    [code=asp]
    <%
    For Each key in Request.Form
    strname = key
    strvalue = Request.Form(ke y)
    Session(strname ) = strvalue
    Next

    formno= Request.Form("f ormno")
    regdate=Request .Form("regdate" )
    clubname1= Request.Form("c lubname1")
    response.write( clubname1)
    clubname3= Request.Form("c lubname2")
    officeclub= Request.Form("o fficeclub")
    surname= Request.Form("s urname")
    firstname= Request.Form("f irstname")
    fathername= Request.Form("f athername")
    dob= Request.Form("d ob")
    resaddress= Request.Form("r esaddress")
    pincode1= Request.Form("p incode1")
    offaddress= Request.Form("o ffaddress")
    pincode2= Request.Form("p incode2")
    offtel= Request.Form("o fftel")
    restel= Request.Form("r estel")
    mobileno= Request.Form("m obileno")
    city= Request.Form("c ity")
    email= Request.Form("e mail")
    supporting= Request.Form("s upporting")
    fees= Request.Form("f ees")
    sqlAdd="select * from player_reg "
    set rsClubName=serv er.CreateObject ("ADODB.Records et")
    openConn
    rsClubName.open sqlAdd,dbc,2,3
    rsClubName.addn ew

    if formno<>"" then
    rsClubName("For mno")=formno
    response.Write( formno)
    end if

    if regdate<>"" then
    rsClubName("Reg istrationdate") =regdate
    end if

    if clubname1<>"" then
    rsClubName("Clu bname1")=clubna me1
    response.Write( clubname1)
    end if

    if clubname3<>"" then
    rsClubName("Clu bname2")=clubna me2
    end if

    if officeclub<>"" then
    rsClubName("Clu bname3")=office club
    end if

    if surname<>"" then
    rsClubName("Sur name")=surname
    end if

    if firstname<>"" then
    rsClubName("Fir stname")=firstn ame
    end if

    if fathername<>"" then
    rsClubName("Fat hersname")=fath ername
    end if

    if dob<>"" then
    rsClubName("DOB ")=dob
    end if

    if resaddress<>"" then
    rsClubName("Res add")=resaddres s
    end if

    if pincode1<>"" then
    rsClubName("Pin code1")=pincode 1
    end if


    if offaddress<>"" then
    rsClubName("Off add")=offaddres s
    end if

    if pincode2<>"" then
    rsClubName("Pin code2")=pincode 2
    end if

    if offtel<>"" then
    rsClubName("Off tel")=offtel
    end if

    if restel<>"" then
    rsClubName("Res tel")=restel
    end if


    if mobileno<>"" then
    rsClubName("Mob no")=mobileno
    end if


    if city<>"" then
    rsClubName("Cit y")=city
    end if

    if email<>"" then
    rsClubName("Ema il")=email
    end if

    if supporting<>"" then
    rsClubName("Sup porting")=suppo rting
    end if

    if fees<>"" then
    rsClubName("fee sid")=fees
    end if

    rsClubName.upda te
    rsClubName.clos e


    %>[/code]
    Last edited by ronverdonk; Apr 3 '08, 12:10 PM. Reason: code tags inserted!
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Next time you post code in a froum, enclose your posted code in [code] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

    Please use [code] tags in future.


    What is this question doing in the PHP forum? PHP is not ASP!

    I will move this thread to the ASP forum.

    moderator
    Last edited by ronverdonk; Apr 3 '08, 12:12 PM. Reason: warning code tags

    Comment

    • DrBunchman
      Recognized Expert Contributor
      • Jan 2008
      • 979

      #3
      Hi nickyspace,

      Are you sure you've set your cursortype and cursorlocation correctly for your record set to be able to update?

      Also, what does the sql string sqlAdd contain?

      Dr B

      Comment

      Working...