Results 1 to 6 of 6

Thread: error exception

  1. #1
    Join Date
    May 2004
    Posts
    21

    Unanswered: 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...

  2. #2
    Join Date
    Dec 2003
    Posts
    454
    Post your piece of code and we can look at it.

  3. #3
    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

  4. #4
    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") & "'"

  5. #5
    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

  6. #6
    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
    %>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •