[thelist] the case of disappearing elements in a recordset
Cory Preus
cory_preus at cnt.com
Fri Jan 26 20:37:31 CST 2001
>can we see the pertinent code?
Okay here it goes...
It sucessfully outputs everything save: rs("dept"), txtCity (one of the
parsed elements), and rs("Date"). Everything else is kosher...and worked
with a DSN connection.
PS. I know there's a bunch misappropriated info pulled in the SQL. The
previous programmer pulled the SQL straight from the internal code and
didn't change it.
I'm gonna owe a big <tip> on this one.
Thanks.
***CODE***
Dim objConn, strConnect, rs
Set objConn = Server.CreateObject("ADODB.Connection")
strConnect = "driver={SQL
Server};SERVER=******;DATABASE=job_posting;UID==******;Password==******;"
objConn.Open strConnect
Set Rs = Server.CreateObject("ADODB.Recordset")
sSQL = "SELECT job_posting.Requisition_Number, "
sSQL = sSQL & "job_posting.Department_Number, job_posting.Position_Title, "
sSQL = sSQL & "job_posting.Reporting_To, job_posting.Summary, "
sSQL = sSQL & "job_posting.Responsibilities, job_posting.Requirements, "
sSQL = sSQL & "job_posting.Date, Division.Division, Department.Department AS
dept, "
sSQL = sSQL & "Grade.Grade AS grade, Location.City AS city, Location.State
AS state, "
sSQL = sSQL & "Contact.Name AS cName, Contact.Phone AS cPhone, Contact.Email
AS cEmail, "
sSQL = sSQL & "Contact.Fax AS cFax "
sSQL = sSQL & "FROM job_posting INNER JOIN "
sSQL = sSQL & "Division ON job_posting.DivisionID = Division.ID INNER JOIN "
sSQL = sSQL & "Department ON "
sSQL = sSQL & "job_posting.DepartmentID = Department.ID INNER JOIN "
sSQL = sSQL & "Grade ON job_posting.GradeID = Grade.ID INNER JOIN "
sSQL = sSQL & "Location ON job_posting.LocationID = Location.ID INNER JOIN "
sSQL = sSQL & "Contact ON job_posting.Contact_ID = Contact.ID "
sSQL = sSQL & "WHERE job_posting.ID=" & txtID
Set rs = objConn.execute(sSQL)
...end of sql...
parsing strings to remove junk
...output...
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td><b><%=Rs("Position_Title") %></b></td>
<td align=right><a
href="apply.asp?ID=<%=txtID%>&apply=null">Apply for this
position</a></td>
</tr>
</table>
<p>
<b>Department:</b> <%=rs("dept")%><p>
<b>Location:</b> <%=txtCity%><p>
<% if Len(txtSummary)>1 then %>
<b>Summary</b><blockquote><%=txtSummary%></blockquote>
<% end if %>
<b>Responsibilities</b><blockquote><%=txtResponsibilities%></blockquote>
<b>Requirements</b><blockquote><%=txtRequirements%></blockquote>
<b>Requisition Number:</b> <%=Rs("Requisition_Number")%><br>
<b>Date: <%=Rs("Date")%></b>
<p>
For more information on this position, contact Human Resources at
<a href="mailto:recruiters at cnt.com?Subject=Information on
Job Posting <%=Rs("Requisition_Number")%> - <%=Rs("Position_Title")%>">
recruiters at cnt.com</a>, fax resumes to (612) 268-6812, or
<br><a href="job_apply.asp?ID=<%=txtID%>&apply=null">
Apply for this position</a>.
<p>
<%
Rs.Close
set Rs=nothing
objConn.Close
Set objConn = nothing
%>
More information about the thelist
mailing list