Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 2nd, 2006, 04:35 AM
Registered User
 
Join Date: Nov 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Retrieve Info from Database

Hi,

I urgently need to solve my problem, I have this page edit_pd.asp which retrieve info from database. I have no problem except for nationality field. There is nothing display to the drop down box.

Quote:
quote:<%
set rs = server.createobject("adodb.recordset")
set tmprs = server.createobject("adodb.recordset")
if Request.QueryString("type") = "edit_pd" then
sql = "select * from student where student_id = " & Request.QueryString("student_id")
rs.open sql,strconnect,0,1

if not rs.eof then
reg_date = rs("reg_date")
stud_id = rs("stud_id")
fileno = rs("fileno")
name = rs("name")
cn_name = rs("cn_name")
passno = rs("passno")
************ = rs("************")
passissue = rs("passissue")
passexpiry = rs("passexpiry")
address = rs("address")
postcode = rs("postcode")
state = rs("state")
country_id = rs("country_id") dob = rs("dob")
hp_no = rs("hp_no")
email1 = rs("email1")
email2 = rs("email2")

end if
rs.close
end if
%>

<tr>
         <td width="407">
         * Nationality&nbsp;&nbsp;
<select name="country_id">
          <option value="0"></option>
          <%
          sql= "select country_id, country_name from country order by country_name ASC"
          rs.open sql, strconnect,0,1
          while not rs.eof
          if country_id = Clng(rs("country_id")) then
          response.write "<option value=" & rs("country_id") & " selected>" & rs("country_name") & "</option>"
          else
          response.write "<option value=" & rs("country_id") & ">" & rs("country_name") & "</option>"
          end if
          rs.movenext
          wend
          rs.close
          %>
        </select>
        
         </td>
         <td colspan="2">Date of Birth (MM/DD/YYYY)
        <input type="text" name="dob" value="<%=dob%>" class="txtbox" size="15" maxlength="15" onfocus="this.blur();">
        <a href="javascript:void(null)" onClick="window.dateField = document.student.dob;
             calendar = window.open('date.asp',null,'WIDTH=185,HEIGHT=203, status=no,toolbar=no,menubar=no,location=no,scroll bars=no,resizable=no,top=0,right=0')">
        <img src="pic/calender.gif" border="0"></a> </td>
</tr>




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve PUBLIC FOLDER INFO using MAPI shivaraj.malannavar Classic ASP Basics 1 November 30th, 2006 12:42 PM
Retrieve info about Lookup RowSource for a table c Proteus_3k Pro VB Databases 0 December 2nd, 2004 07:05 AM
Retrieve Info... betzy XML 7 June 4th, 2004 02:10 AM
Getting info from database -between dates doranaz Classic ASP Databases 2 December 23rd, 2003 01:02 AM
Deleting info from Database... jasmine5544 Classic ASP Databases 1 December 2nd, 2003 03:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.