executing SQL query using ASP?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerome

    executing SQL query using ASP?

    Hi,

    I've got the following problem and I don't know how to make this (if
    it's possible at all):

    I want to make a form where the user can enter a criteria and then,
    after pushing a button or link, a certain table in a certain DB is
    updated. So it's not about updating a single record, but a whole table!
    The single update is no problem using Dreamweaver for example.

    What I want in fact is simply execute an SQL update query ...

    Any help is appreciated

  • Roji. P. Thomas

    #2
    Re: executing SQL query using ASP?

    Open a connection using ADO
    execute the Query againest your statement.


    --
    Roji. P. Thomas
    SQL Server Programmer ;)
    _______________ _________
    "Jerome" <jherr@NOSPAM.m nhn.lu> wrote in message
    news:uZMTumAsDH A.4060@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Hi,
    >
    > I've got the following problem and I don't know how to make this (if
    > it's possible at all):
    >
    > I want to make a form where the user can enter a criteria and then,
    > after pushing a button or link, a certain table in a certain DB is
    > updated. So it's not about updating a single record, but a whole table!
    > The single update is no problem using Dreamweaver for example.
    >
    > What I want in fact is simply execute an SQL update query ...
    >
    > Any help is appreciated
    >[/color]


    Comment

    • Jeff Cochran

      #3
      Re: executing SQL query using ASP?

      On Fri, 21 Nov 2003 09:29:55 +0100, Jerome <jherr@NOSPAM.m nhn.lu>
      wrote:
      [color=blue]
      >I've got the following problem and I don't know how to make this (if
      >it's possible at all):
      >
      >I want to make a form where the user can enter a criteria and then,
      >after pushing a button or link, a certain table in a certain DB is
      >updated. So it's not about updating a single record, but a whole table!
      >The single update is no problem using Dreamweaver for example.
      >
      >What I want in fact is simply execute an SQL update query ...[/color]

      Well, stop using Dreamweaver and it's simple. :)

      Okay, bad dig. This is simply normal ASP/ADO stuff. Open an ADO
      connection, and run the query on that connection. Something along the
      lines of:

      (Access Database)

      dbConnect = "PROVIDER=Micro soft.Jet.OLEDB. 4.0;DATA SOURCE=" &
      Server.MapPath( "database.m db") & ";"
      set Connect = server.CreateOb ject("ADODB.Con nection")
      Connect.Open dbConnect
      strSQL = "UPDATE table SET field = 'New Data'"
      Connect..Execut e (strSql)

      As long as you know how to create the SQL query, it's not a big deal
      to do the rest.

      For other ADO connections such as to SQl Server, look at:



      Jeff

      Comment

      Working...