"unspecified error"

This is a discussion on ""unspecified error"" within the Classic ASP section. This forum, and the thread ""unspecified error" are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 17th, 2005, 21:05
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
"unspecified error"

hi guys

i have a few pages that connect to the same database

if i click on one, and then another, on the second page i get an "unspecified error" - im guessing this might be because i havent closed connections or something?

but i use this code at the end:

Code: Select all
set rs = nothing
set conn = nothing
help would be much appreciated

thanks

  #2 (permalink)  
Old Apr 17th, 2005, 23:46
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
you have to close the connection to the database...

Code: Select all
conn.close
set conn = nothing
%>
  #3 (permalink)  
Old Apr 18th, 2005, 06:18
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks john i'll try it as soon as i get off my mobile and onto a pc!
  #4 (permalink)  
Old Apr 18th, 2005, 08:05
Highly Reputable Member
Join Date: Jul 2003
Location: Ipswich, UK
Posts: 690
Thanks: 0
Thanked 0 Times in 0 Posts
Ben, you read this forum on your mobile? How?!?
  #5 (permalink)  
Old Apr 18th, 2005, 10:12
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Actually, connections to the database, and objects are cleared up automatically when the page loses it's scope..... however, manual clearing up of objects and closing connections is always good practice because you release the resources when they are done with.... which could be well before the page finishes proccesing.

Many pages can access the database at the same time unless your connection string specifies an EXCLUSIVE connection, which aint gonna be the case.

Seems as though you have an error prolly caused by your SQL statement or some object being used wrongly.

Smokie..... I reckon he prolly has an HTML capable phone.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #6 (permalink)  
Old Apr 18th, 2005, 16:11
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
i have a nokia 6260 - its fully html compatible

thanks guys
  #7 (permalink)  
Old Apr 18th, 2005, 17:48
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
ok guys...

still getting the unspecified error!
  #8 (permalink)  
Old Apr 18th, 2005, 17:57
Reputable Member
Join Date: Sep 2004
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Post the code. Only way we can tell. Ohh, and Rob's right... you dont really have to close the connection, just good practice. It shouldn't error if you dont though.
  #9 (permalink)  
Old Apr 18th, 2005, 18:01
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
Code: Select all
<%

Dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")

>>> oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=" & Server.MapPath(".") & "\news.mdb;" & _
"Uid=admin;" & _
"Pwd="

Dim rs

set rs = Server.CreateObject("ADODB.RecordSet")

rs.Open "SELECT * FROM messages ORDER BY ddate DESC",oConn

if rs.eof = true then
response.write "No messages have been left."
response.write "

"
end if

while not rs.EOF

response.write "<table cellspacing='0' cellpadding='0' style='width:400px'>"
response.write "<tr>"
response.write "<td style='height:21px;width:400px;background-image:url(images/bar.jpg);border:1px solid #000000;'>"
response.write ""
response.write rs("ddate")
response.write "</td></tr><tr>"
response.write "<td style='width:400px;border:1px solid #000000;border-top:none;padding:5px;'>"
response.write rs("news")
response.write "<p align='right'>"
response.write "Added by: "
response.write rs("author")
response.write "</td></tr></table>"
response.write "
"

rs.moveNext

Wend

set rs = nothing
oConn.close
set oConn = nothing

%>
its the line with the arrow pointing to it - however, it sometimes works....[/i]
  #10 (permalink)  
Old Apr 19th, 2005, 15:35
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
hey guys... anyone got any ideas? it worked for a bit, but now its gone back to not working...?
  #11 (permalink)  
Old Apr 19th, 2005, 19:14
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Yeah.... lol

Make sure you dont have the DB open in access!!!

LMAO!

I bet that's it!
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #12 (permalink)  
Old Apr 20th, 2005, 16:49
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
you get a different error if you do that rob - a temporary volatile thingy error

and i'm not that stupid! :P
  #13 (permalink)  
Old Apr 20th, 2005, 16:52
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Quote:
you get a different error if you do that rob - a temporary volatile thingy error

and i'm not that stupid!
I was not implying that Ben..... it's just that we've all done it, and all of us wondered why (sometimes for hours) until we knew better.

Have you recently updated MDAC?

If so, roll back and see if you still have an issue.

If you have not recently upgraded, then maybe see if you have an updates. look on microsoft for MDAC updates.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #14 (permalink)  
Old Apr 20th, 2005, 16:54
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
whats MDAC?
  #15 (permalink)  
Old Apr 20th, 2005, 17:04
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,953
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Microsoft Data Access Components.

They are the objects used when connecting to a database.... they include ODBC drivers and all the other gubbins needed.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #16 (permalink)  
Old Apr 22nd, 2005, 10:08
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 23
Posts: 1,649
Blog Entries: 1
Thanks: 0
Thanked 4 Times in 4 Posts
I know that error...
I used to get it all the time.

it happens when you try to output the contents of an empty recordset.

the error in your logic is that you're forgetting to check whether rs.bof is true...

just change it to:
Code: Select all
if rs.eof or rs.bof then 
 ' whatever
end if

rs.movefirst
while not rs.EOF 
 ' whatever
loop
personally, I use this function:
Code: Select all
Function EmptyRS(ByRef rs)
 On Error Resume Next
 EmptyRS = CBool(rs.EOF Or rs.BOF)
End Function
usage:
Code: Select all
rs.Open sql, con
If Not EmptyRS(rs) Then
 ' loop through and do whatever...
End If
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Closed Thread

Tags
quotunspecified, errorquot

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a "tag" system to find relevant "related" pages MrQuestions PHP Forum 3 Mar 20th, 2008 23:06
[SOLVED] Getting the &quot;Microsoft JET Database Engine error '80040e14'&quot; error. VegaLA Classic ASP 3 Jan 26th, 2008 00:12
[SOLVED] Show "Image" Depends On User "Status"? Monie Classic ASP 6 Oct 16th, 2007 01:22
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Starting Out 6 Aug 8th, 2007 13:48
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09


All times are GMT. The time now is 07:22.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43