If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > error exception

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-05, 20:18
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
error exception

hi - again
I was wondering and Iam still wondering what does this error means and when it occurs

Error Type:
(0x80020009)
Exception occurred.
/willness/conn.asp, line 19

in my case on 19 line is INSERT INTO SQL query. after that query i have another query UPDATE... first query works fine witout the second...

sometimes I have problems with this error and suddenly just disappear and I didn't do anything

when I tried to access my site (on localhost) with FireFox it reports this error
in that time, I was on my site with IE and I tried to do semething with two browsers in one time...

I will be apreciated if somebody would tell me more info on this error... when it occurs, and what it means...

thx...
Reply With Quote
  #2 (permalink)  
Old 01-13-05, 17:34
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
Post your piece of code and we can look at it.
Reply With Quote
  #3 (permalink)  
Old 01-14-05, 19:06
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
Quote:
Originally Posted by gyuan
Post your piece of code and we can look at it.
Code:
if not isEmpty(session("UName")) then
	korisnik.Open "SELECT * FROM online WHERE username='" & session("UName") & "';", conn

	if NOT korisnik.EOF then
		conn.Execute("UPDATE online SET datum='" & now() & "',ip='" & Request.ServerVariables("REMOTE_ADDR") & "' WHERE username='" & session("UName") & "';")
	else
		conn.Execute("INSERT INTO online (username,datum,ip) VALUES ('" & session("UName") & "','" & now() & "','" & Request.ServerVariables("REMOTE_ADDR") & "');")
		conn.Execute("UPDATE users SET active=1 WHERE korisnickoime='" & session("UName") & "';")
	end if
end if
'korisnik.Close
Reply With Quote
  #4 (permalink)  
Old 01-14-05, 20:14
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
At the end of your query statements, you can not add ";", i.e.,

"SELECT * FROM online WHERE username='" & session("UName") & "';"

should be

"SELECT * FROM online WHERE username='" & session("UName") & "'"
Reply With Quote
  #5 (permalink)  
Old 01-15-05, 06:53
kasic kasic is offline
Registered User
 
Join Date: May 2004
Posts: 21
Quote:
Originally Posted by gyuan
At the end of your query statements, you can not add ";", i.e.,

"SELECT * FROM online WHERE username='" & session("UName") & "';"

should be

"SELECT * FROM online WHERE username='" & session("UName") & "'"

you think this is problem?
I don't know why is that, but other SQL query's that ends with ';' works fine...


do you now something more about that error? or place where I can find more info about it?
thx
Reply With Quote
  #6 (permalink)  
Old 01-17-05, 13:47
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
You should not add ";" after sql statement if your database is MS SQL server. You may need to close the record set before you try to update the same row of data. Try the following code:

<%
Dim found
if not isEmpty(session("UName")) then
korisnik.Open "SELECT * FROM online WHERE username='" & session("UName"), conn

if NOT korisnik.EOF then
found = true
else
found = false
end if
korisnik.Close

if found then
conn.Execute("UPDATE online SET datum='" & now() & "',ip='" & Request.ServerVariables("REMOTE_ADDR") & "' WHERE username='" & session("UName") & "'")
else
conn.Execute("INSERT INTO online (username,datum,ip) VALUES ('" & session("UName") & "','" & now() & "','" & Request.ServerVariables("REMOTE_ADDR") & "')")
conn.Execute("UPDATE users SET active=1 WHERE korisnickoime='" & session("UName") & "'")
end if

end if
%>
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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