all groups > inetserver asp db > may 2005 >
You're in the

inetserver asp db

group:

Updating records?



Updating records? Jon
5/28/2005 12:00:00 AM
inetserver asp db: Using the follow format (or similar) for accessing data from a database and
any other required operations. How would I go about an update query? I'm
aware it's a case of setting sSQL to "Update [Table] SET" etc but what
constants should use and where?

myDSN="Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Program Files\Apache Group\Apache2\htdocs\ADO\users.mdb"

set CN=server.createobject("ADODB.Connection")
CN.Open myDSN

sSQL =

set cmd=Server.Createobject("ADODB.command")
with cmd
.CommandText=sSQL
.CommandType=
Set .ActiveConnection=CN
on error resume next
.Execute ,array
end with

CN.close

Thanks,

--
Jon
warpedpixel@gmail.com
Look at that dead pixel on your screen! *SLAP* Gotcha!

Re: Updating records? josephweiss NO[at]SPAM gmail.com
6/7/2005 5:13:17 AM
Here you go...

SQL = "SELECT ID,name,email FROM [your Table] WHERE
ID="&request.form("ID")&""
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = 2
rs.LockType = 3
rs.Open MySQL, CN
rs.fields("name") = request.form("name")
rs.fields("email") = request.form("email")
rs.Update
rs.Close
Set rs = Nothing

CN.close
set CN = nothing
AddThis Social Bookmark Button