This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Front Page > April 2004 > upadting db





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author upadting db
Matt Shudy

2004-04-30, 5:33 pm

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
Kevin Spencer

2004-04-30, 5:33 pm

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.

"Matt Shudy" <anonymous@discussions.microsoft.com> wrote in message
news:6a2c01c42eb5$7da218f0$a101280a@phx.gbl...
> 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



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews