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. Advertisements

  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. Advertisements

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,456
  2. Paul M

    SQL database table ot SQL schema

    Paul M, Dec 8, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    542
    Mythran
    Dec 8, 2003
  3. Biggie
    Replies:
    1
    Views:
    3,770
    Alvin Bruney [MVP]
    Feb 6, 2004
  4. =?Utf-8?B?UmV6YQ==?=
    Replies:
    3
    Views:
    18,477
    Carlos Barini
    Jun 7, 2004
  5. =?Utf-8?B?UmV6YQ==?=
    Replies:
    2
    Views:
    1,989
    bruce barker
    Jun 8, 2004
  6. mahesh
    Replies:
    3
    Views:
    5,137
    cb_1987
    Apr 6, 2010
  7. ecoolone
    Replies:
    0
    Views:
    955
    ecoolone
    Jan 3, 2008
  8. naveenduttvyas
    Replies:
    0
    Views:
    1,193
    naveenduttvyas
    Nov 26, 2008
Loading...