SQL error?

Discussion in 'ASP General' started by Jerome, Apr 27, 2004.

  1. Jerome

    Jerome Guest

    Hi,

    I've got the following code but my records don't get updated ... Is
    anyone seeing why? Just looking at the code? Any help is appreciated!

    Jerome

    <%
    'Dimension variables
    Dim adoCon 'Holds the Database Connection Object
    Dim strSQL 'Holds the SQL query to query the database

    Set adoCon = Server.CreateObject("ADODB.Connection")
    adoCon.Open "DSN=IntranetDB"

    NewsInt=request.querystring("textfield")

    strSQL="UPDATE activites_edu_bkp SET "
    strSQL= strSQL & "testfeld='yes'"
    strSQL= strSQL & " WHERE news='" & NewsInt & "'"
    on error resume next
    adoCon.Execute sql
    if err<>0 then
    response.write( "*" & NewsInt & "No update permissions!")
    else
    response.write("Records for " & NewsInt & " updated!")
    end if
    adoCon.close
    %>
     
    Jerome, Apr 27, 2004
    #1
    1. Advertising

  2. Jerome

    Jerome Guest

    Please ignore my question, found the error!

    Jerome wrote:

    > Hi,
    >
    > I've got the following code but my records don't get updated ... Is
    > anyone seeing why? Just looking at the code? Any help is appreciated!
    >
    > Jerome
    >
    > <%
    > 'Dimension variables
    > Dim adoCon 'Holds the Database Connection Object
    > Dim strSQL 'Holds the SQL query to query the database
    >
    > Set adoCon = Server.CreateObject("ADODB.Connection")
    > adoCon.Open "DSN=IntranetDB"
    >
    > NewsInt=request.querystring("textfield")
    >
    > strSQL="UPDATE activites_edu_bkp SET "
    > strSQL= strSQL & "testfeld='yes'"
    > strSQL= strSQL & " WHERE news='" & NewsInt & "'"
    > on error resume next
    > adoCon.Execute sql
    > if err<>0 then
    > response.write( "*" & NewsInt & "No update permissions!")
    > else
    > response.write("Records for " & NewsInt & " updated!")
    > end if
    > adoCon.close
    > %>
     
    Jerome, Apr 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dna
    Replies:
    1
    Views:
    1,278
  2. William \(Bill\) Vaughn
    Replies:
    0
    Views:
    449
    William \(Bill\) Vaughn
    Aug 21, 2003
  3. mahesh
    Replies:
    3
    Views:
    4,697
    cb_1987
    Apr 6, 2010
  4. ecoolone
    Replies:
    0
    Views:
    763
    ecoolone
    Jan 3, 2008
  5. naveenduttvyas
    Replies:
    0
    Views:
    950
    naveenduttvyas
    Nov 26, 2008
Loading...

Share This Page