changing from string to interger type

Results 1 to 2 of 2

Thread: changing from string to interger type

  1. #1
    Join Date
    Dec 1969

    Default changing from string to interger type

    my tables are:<BR>skills: skill(str), skillID(autonumber))<BR>subcategory: subcategory(str), subcategoryid(autonumber), skillID(int)<BR><BR>i am obtaining the value for skill in the string type via a text box(strSkill). however, i need to save this value to the subcategory table as its ID number (ie as an interger value). i am trying to use a SQL statement to derive its related ID, but am failing to do so. where is the problem?<BR><BR>dim sql<BR>sql = "SELECT DISTINCT SkillID FROM Skills WHERE (((Skills.Skill)=&#039;" & replace(strSkill,"&#039;","&#039;&#039;") & "&#039;))"<BR>Set RS = objConn.Execute(SQL)<BR><BR><BR>If Not bolAlreadyExists Then<BR><BR>RS.AddNew<BR>&#039;adding the new subskill to the table<BR><BR>RS("SubCategory") = Request.Form("SubCategory")<BR>RS("SkillID") = Request.Form("Skills")<BR>&#039;closing the recordset and connection object<BR>RS.Update<BR>RS.Close<BR><BR>thank you!:)

  2. #2
    Join Date
    Dec 1969

    Default RE: changing from string to interger type

    You don&#039;t show where you populate the strSkill variable.<BR><BR>You dont&#039; use the value from RS("SkillID") after you get it, you&#039;ve continued to use Request.Form("Skills").<BR><BR>Are you sure it&#039;s a POST method instead of GET?<BR><BR>Try some debuggin.. what is the value if "strSkill". What is the value of RS("SkillID").

Posting Permissions

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