changing customer details -> how do you set a select to db data

Results 1 to 2 of 2

Thread: changing customer details -> how do you set a select to db data

  1. #1
    Join Date
    Dec 1969
    Posts
    733

    Default changing customer details -> how do you set a select to db data

    Hi, <BR>I&#039ve got a page which changes customer details and am populating their current data into the text fields - that&#039s fine. How do you set the selected option in a dropdown to that field in the database. eg in a static list of countries, how do you set the country stored in the db to the form dropdown??<BR><BR>Thanks<BR>Derek<BR>(kipps@iafric a.com)

  2. #2
    lincolntc Guest

    Default RE: changing customer details -> how do you set a select to db data

    I hope this answers your question. This is a snippet from one of my pages.<BR><BR>&#060;body&#062;<BR> &#060;CENTER&#062;&#060;H1&#062;Staff Directory&#060;/H1&#062;&#060;/CENTER&#062;&#060;HR&#062;<BR><BR> &#060;%<BR> Set vConnection = Server.CreateObject("ADODB.Connection")<BR> vConnection.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("united.mdb")<BR><BR> Set vCommand = Server.CreateObject("ADODB.Command")<BR> vCommand.CommandText = "SELECT dept FROM united GROUP BY dept"<BR> vCommand.CommandType = 1<BR><BR> Set vCommand.ActiveConnection = vConnection<BR> <BR> Set vRecordSet = Server.CreateObject("ADODB.Recordset")<BR> <BR> vRecordSet.Open vCommand<BR> %&#062;<BR> <BR> &#060;%<BR> Sub verfiyNewRecordSet()<BR> vCommand.CommandType = 1<BR> Set vRecordSet = Server.CreateObject("ADODB.Recordset")<BR> vRecordSet.Open vCommand<BR> End Sub<BR> %&#062;<BR><BR> &#060;H2&#062;Search For Staff Member By:&#060;/H2&#062;&#060;HR&#062;<BR><BR> &#060;FORM ACTION="staffResults.asp" METHOD="POST" TARGET="mainbody" NAME="searchCriteriaForm"&#062;<BR> &#060;TABLE&#062;<BR> &#060;TR&#062;<BR> &#060;TD WIDTH="200"&#062;<BR> &#060;SELECT NAME="SearchCriteria" SIZE="1"&#062;<BR> &#060;OPTION&#062;Department&#060;/OPTION&#062;<BR><BR> &#060;%<BR> Do While NOT vRecordSet.EOF<BR> %&#062;<BR> &#060;OPTION&#062;&#060;%Response.Write(vRecordSet ("Dept"))%&#062;&#060;/OPTION&#062;<BR> &#060;%<BR> vRecordSet.movenext<BR> Loop<BR> %&#062;<BR> &#060;/SELECT&#062;<BR> &#060;/TD&#062;<BR> &#060;TD&#062;<BR> &#060;INPUT TYPE="Hidden" NAME="vHiddenSearchValue" VALUE="dept"&#062;<BR> &#060;INPUT TYPE="Submit" NAME="cmdSubmit" VALUE="Search !"&#062;<BR> &#060;/TD&#062;<BR> &#060;/TR&#062;<BR> &#060;/TABLE&#062;<BR> &#060;/FORM&#062;<BR>&#060;/body&#062;

Posting Permissions

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