How to get hold of this...

Results 1 to 3 of 3

Thread: How to get hold of this...

  1. #1
    prakash Guest

    Default How to get hold of this...

    I am using a dropdown in one of my ASP and have used the keyword *MULTIPLE*.<BR><BR>If the user selects more than one then the result is something like this<BR>BranchCode 1,6,8<BR><BR>I would like to know how to get a grip of this data, to enable it to insert into the database.<BR>I am confused because user may select one or more than one, if he selects only one data, then its no problem, I can easily enter into the DB, but now more than one, I am vexed. please help me on this.<BR><BR>Thanks all.

  2. #2
    Join Date
    Dec 1969

    Default RE: How to get hold of this...

    You could search through the data item by item using InStr()

  3. #3
    Join Date
    Dec 1969

    Default RE: How to get hold of this...

    Why not split the selections intom an array and build your sql statement based on this, i.e. :<BR><BR>if request("BranchCode") &#060;&#062; "" then<BR> arySelections = split(request("BranchCode"),",")<BR> SQL = ""<BR><BR> if ubound(arySelections) &#062; 0 then<BR> for i = 0 to ubound(arySelections)<BR> SQL = SQL & "INSERT INTO tablename (BranchCode) VALUES (" & arySelections(i) & ");"<BR> next<BR> else<BR> SQL = "INSERT INTO tablename (BranchCode) VALUES (" & arySelections(0) & ");"<BR> end if<BR>&#039;Response.Write SQL<BR>objConn.execute(SQL)<BR>end if<BR><BR><BR>get the idea?<BR><BR><BR>MikeD

Posting Permissions

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