Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
cmh
Starting Member
20 Posts |
Posted - 2004-09-07 : 16:13:10
|
| I receive the following error when selecting the option to list all job openings.error '80020009' Exception occurred. /Previousjobpostings.asp, line 92 The code listed as in error is:If DateDiff("m", Now, objBulletinsRecordSet.fields.item("PubDate")) = 0 thenCan anyone see a problem with this? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-09-07 : 16:18:35
|
well it could mean that your PubDate is null or objBulletinsRecordSet doesn't exist...maybe if u showed us the sql that fills the recordSet...Go with the flow & have fun! Else fight the flow |
 |
|
|
cmh
Starting Member
20 Posts |
Posted - 2004-09-07 : 16:51:22
|
| Is this what you need to see?<% Session("ConnInfo") = "dsn=intranet;" & strSQLUser & strSQLPassword & """" Session("Table") = "IntranetJobPostings" Set objBulletinsRecordSet = Server.CreateObject("ADODB.Recordset") objBulletinsRecordSet.ActiveConnection = Session("ConnInfo") Select Case request.querystring("SortMethod") Case "DateDsc" SQL = "Select * FROM IntranetJobPostings order by PubDate DESC; " Case "DateAsc" SQL = "Select * FROM IntranetJobPostings order by PubDate; " Case "PointOfContactAsc" SQL = "Select * FROM IntranetJobPostings order by PointOfContact; " Case "PointOfContactDsc" SQL = "Select * FROM IntranetJobPostings order by PointOfContact DESC; " Case Else SQL = "Select * FROM IntranetJobPostings order by PubDate DESC; " End Select objBulletinsRecordSet.Source = SQL objBulletinsRecordSet.CursorType = 0 objBulletinsRecordSet.CursorLocation = 2 objBulletinsRecordSet.LockType = 3 objBulletinsRecordSet.Open If objBulletinsRecordSet.EOF Then ' Display no results were found Response.Write "<table width=""94%"" align=""center"" border=""0"" cellspacing=""0"" cellpadding=""0"">" Response.Write "<tr>" Response.Write "<td width=""3%"" align=""left"" valign=""middle""><img src=""images/spacer.gif"" width=""19"" height=""15"" border=""0""></td>" Response.Write "<td width=""97%""><font size=""2"">No job postings found in database. Please contact IT Support.</font></td></tr>" Response.Write "<tr bgcolor=""#C5C5C5"">" Response.Write "<td colspan=""2"" align=""left"" valign=""middle""><img src=""images/spacer.gif"" width=""1"" height=""1"" border=""0""></td></tr>" Else Response.Write "<table width=""97%"" align=""center"" border=""0"" cellspacing=""0"" cellpadding=""0"">" intBulletinCounter = 0 While intBulletinCounter < intPreviousBulletinDisplay Response.Write "<tr><td width=""3%"" align=""left"" valign=""middle"">" If DateDiff("m", Now, objBulletinsRecordSet.fields.item("PubDate")) = 0 then Response.Write "<img src=""images/front_bullet_red.gif"" alt=""New new month"" width=""19"" height=""15"" border=""0"">" Else Response.Write "<img src=""images/front_bullet_grey.gif"" alt="""" width=""19"" height=""15"" border=""0"">" End If Response.Write "</td><td width=""97%""><font size=""2"">" Response.Write " [" Select Case request.querystring("SortMethod") Case "DateDsc" Response.Write FormatDateTime(objBulletinsRecordSet.Fields.Item("PubDate"),VBShortDate) Case "DateAsc" Response.Write FormatDateTime(objBulletinsRecordSet.Fields.Item("PubDate"),VBShortDate) Case "PointOfContactAsc" Response.Write objBulletinsRecordSet.Fields.Item("PointOfContact") Case "PointOfContactDsc" Response.Write objBulletinsRecordSet.Fields.Item("PointOfContact") Case Else Response.Write FormatDateTime(objBulletinsRecordSet.Fields.Item("PubDate"),VBShortDate) End Select Response.Write "] " Response.Write "<a href=""displayjobposting.asp?bulletinid=" & objBulletinsRecordSet.Fields.Item("ID") & """>" & objBulletinsRecordSet.Fields.Item("Title") & "</a></font></td>" Response.Write "</tr><tr bgcolor=""#C5C5C5"">" Response.Write "<td colspan=""2"" align=""left"" valign=""middle""><img src=""images/spacer.gif"" alt="""" width=""1"" height=""1"" border=""0""></td></tr>" objBulletinsRecordSet.movenext intBulletinCounter = intBulletinCounter + 1 Wend End If%> |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-09-07 : 23:17:07
|
| did you check if the connection was really established? |
 |
|
|
cmh
Starting Member
20 Posts |
Posted - 2004-09-08 : 10:12:48
|
| The connection is definitely established because it brings in all my data and then gives me that error at the end. It lists every record in the test file just fine, but it seems something hangs up at the end. I am trying to copy this code from another application. It seems that as soon as I change the table name in the code this is when the error occurs. The code runs fine with the old table name in it. I kept all field names the same so far for the test so it can't be that I have a field name problem. Permissions are okay on the table since it is presenting the data. |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2004-09-09 : 01:27:38
|
just read your code (first time to read a code here, usually lazy )While intBulletinCounter < intPreviousBulletinDisplayis this "intPreviousBulletinDisplay" set? also you may be running into an eof error coz you're not checking in your while loop if it's eof |
 |
|
|
|
|
|
|
|