executing SQL query using ASP?

J

Jerome

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
 
J

Jeff Cochran

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

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=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" &
Server.MapPath("database.mdb") & ";"
set Connect = server.CreateObject("ADODB.Connection")
Connect.Open dbConnect
strSQL = "UPDATE table SET field = 'New Data'"
Connect..Execute (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:

http://www.able-consulting.com/ADO_Conn.htm

Jeff
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,358
Latest member
AlexSon

Latest Threads

Top