Dynamic Dropdown with a twist
Hello all. I am not really a programmer, just a graphic artist that knew html and is now suddenly web designing when the programmer left. So, please help and forgive poor wording.
I have an employee fired/quit form that collects all the pertinent information, inserts it into a database (EMPLOYEE) and emails the appropriate people. Works like a charm.
I also have a employee directory (EMPDIR) that shows the person's name, IMAGE, department, hire and birth date. Also, works like a charm.
Now, TPTB want me to have the fired person's IMAGE appear on the notice that is emailed out when the Fired/Quit form is filled out. The problem comes in that the Directory and the Quit Form are on two different databases. I want to populate a dropdown list with the image names from the database 'EMPDIR' (Employee Directory) on the Quit Form that is on the database 'EMPLOYEE'. This is what I have so far. It shows the dropdown place holder, but it is not populated and the form goes no further. There are no error codes, so I know I'm close, just not quite there yet.
I have this on the page where I want my dropdown to show up.
<select size="1" name="IMAGE">
<% conn2.open "SERVER=XXX;DATABASE=EMPDIR;UID=YYY;PWD=ZZZ;"
Set rs1 = Server.CreateObject("adodb.recordset")
cmdTemp.CommandText = "SELECT distinct IMAGE FROM directory"
rs1.Open cmdTemp, , AdOpenStatic
while not rs1.eof
%>
<option value="<%=rs1("IMAGE")%>"><%=rs1("IMAGE")%></option>
<%
rs1.movenext
wend
rs1.close
%>
</select>
I hope that's enough code for you, if not, please let me know.
Can anyone help me figure this out? Am I even close?
Thanks in advance.
Jackie
|