passing values



Do While Not RS.EOF
Response.Write ""
Response.Write RS("Skill")
RS.MoveNext
Loop
Response.Write (Session("strSkill"))


As can be seen, most of the values in the combo box return integer values (SkillID), however, the last value (strSkill) has been passed from another form and is a string value. in the next form, the following code can be seen, to add a record to the subcategory table:

Dim strSkill
strSkill = Request.Form("Skills")
'Response.Write Request("skills")


if (Request("skills") = "Add") then
Response.Write Request("skills")
dim sql
sql = "SELECT SkillID FROM Skills WHERE (((Skills.Skill)='" & replace(strSkill,"'","''") & "'))"
'Set RS = objConn.Execute(SQL)
'If Not bolAlreadyExists Then

RS.AddNew
'adding the new subskill to the table

RS("SubCategory") = Request.Form("SubCategory")
RS("SkillID") = objConn.Execute(sql)
'closing the recordset and connection object
RS.Update
RS.Close
....
else
.....
i wish to obtain to SkillID relating to StrSkill (from the skills table in the database) as i need this interger SkillID value when adding the record to the table.....how do i do this? i keep getting errors!
thank you!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories