upadting db

M

Matt Shudy

Hey,

I am trying to use asp code to update a database record...
The book that I have only says you have to this:
objRS("Password")=Request.Form("Password")
objRS.Update
I tried this, but I think that this needs to be changed...
Dim strSQL
strSQL= "SELECT * FROM Password"
Dim objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn
If I am going about this all wrong, please try to stear me
in the right path. Otherwise, what do I need to
change/add?

Thanks,

Matt Shudy
 
K

Kevin Spencer

There are 2 ways to update a record using ADO. One is to pass a query (e.g.
"UPDATE MyTable SET SomeColumn = 'Some Value') that updates the record. The
other is to open an updateable RecordSet, change a value in a record, and
call the Update method to update the underlying data source. Considering
your level of expertise, I would recommend using a query.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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

Top