Howdy, Stranger!

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

Categories

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!

Comments

  • Andre YoungAndre Young USAMember Posts: 0

    ________ // http://forcoder.org // free video tutorials and ebooks about ( Java Objective-C C Perl Swift PHP C# Ruby MATLAB Visual Basic PL/SQL C++ Assembly Scratch Python Go Delphi Visual Basic .NET JavaScript R ABAP Apex Dart Crystal VBScript FoxPro Awk SAS Ada Scala Transact-SQL Alice Lisp Clojure Logo Lua Prolog Rust Scheme Fortran COBOL Julia Erlang Hack Bash ML Kotlin F# D LabVIEW ) _

Sign In or Register to comment.