how to add to fields from a access database to a list box using asp code
-
this is my code...and i want the code to display two fields together concatenate them in the list box that is the code and description...when i run it with in the browser displays a Error Type: Microsoft VBScript compilation (0x800A03EE) Expected ')' line 64, column 47 <% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT code ,description FROM projects" oRs.Open strSQL, conn Do while not oRs.EOF if Request.Form("code") = oRs("Code") then Response.Write ("& ("description") ") oRs.MoveNext else Response.Write ("& ("description") ") oRs.MoveNext end if loop %> bobo
-
this is my code...and i want the code to display two fields together concatenate them in the list box that is the code and description...when i run it with in the browser displays a Error Type: Microsoft VBScript compilation (0x800A03EE) Expected ')' line 64, column 47 <% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT code ,description FROM projects" oRs.Open strSQL, conn Do while not oRs.EOF if Request.Form("code") = oRs("Code") then Response.Write ("& ("description") ") oRs.MoveNext else Response.Write ("& ("description") ") oRs.MoveNext end if loop %> bobo
Should this not be:
bobolov wrote:
Response.Write ("& ("description") ")
Response.Write ("" & oRs.Fields("description") & " "
-
Should this not be:
bobolov wrote:
Response.Write ("& ("description") ")
Response.Write ("" & oRs.Fields("description") & " "
is there any other way doing this...i need two feilds in the listbox option...thanks for all the help...im new to this :)... Error Type: Microsoft VBScript compilation (0x800A03EE) Expected ')'
<% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT code ,description FROM projects" oRs.Open strSQL, conn Do while not oRs.EOF if Request.Form("code") = oRs("Code") then Response.Write ("" & oRs.Fields("description") & " " oRs.MoveNext else Response.Write ("" & oRs.Fields("description") & " " oRs.MoveNext end if loop %> bobo... -- modified at 2:22 Tuesday 13th June, 2006