|
 |
asp_databases thread: Updating records in Access databases
Message #1 by "Niels J. Nielsen" <njn@e...> on Wed, 12 Apr 2000 21:21:29
|
|
In VBScript Programmers Reference chapter 15 p. 449, there are an example
on "Adding a new row to the recordset". It is pointet out that this is not
supported i Access, Why?, and can you suggest a method for updating Access
databases in server side ASP.
Kind regards
Niels J. Nielsen
Message #2 by "PRJ (Pernille Rosendahl Jacobsen)" <PRJ@n...> on Fri, 14 Apr 2000 10:00:39 +0200
|
|
The following script works perfectly in ASP server side against an Access
database, so why the VBscipt books says otherwise I don't know.
<!-- #include file="../scripts/adovbs.inc" -->
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open "XXX"
Set objRec = Server.CreateObject ("ADODB.Recordset")
objRec.ActiveConnection = ObjConn
objRec.CursorType = adOpenKeyset
objRec.LockType = adLockOptimistic
objRec.Source = "TEST"
objRec.Open
%>
<% If Not IsEmpty(Request.Form) Then
objRec.AddNew
objRec.Fields("First_Name").value = Request.Form("First_Name")
objRec.Fields("Last_Name").value = Request.Form("From")
objRec.Fields("Address").value = Request.Form("Address")
objRec.Fields("zipcode").value = Request.Form("zipcode")
objRec.Fields("city").value = Request.Form("city")
objRec.Fields("country").value = Request.Form("country")
objRec.Update
objRec.Requery
End if
objRec.Close
Set objRec = Nothing
Kind Regards,
Pernille Jacobsen
-----Original Message-----
From: Niels J. Nielsen
Sent: 12 April, 2000 23:21
To: ASP Databases
Subject: [asp_databases] Updating records in Access databases
In VBScript Programmers Reference chapter 15 p. 449, there are an example
on "Adding a new row to the recordset". It is pointet out that this is not
supported i Access, Why?, and can you suggest a method for updating Access
databases in server side ASP.
Kind regards
Niels J. Nielsen
---
|
|
 |