Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: rs.AddNew doesn't work


Message #1 by wilfree_baluja@h... on Fri, 22 Nov 2002 07:42:09
I have problems to update registers. The following is a portion of a very 
simple app, but it doesn't work. I have Access 2000 working in local 
server with IIS 5.0

<%
Option Explicit
Response.Expires = -1000

Dim Conn
Dim RS
dim dato

Set Conn = Server.CreateObject("ADODB.Connection")
'Conn.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" 
+ "C:\Inetpub\wwwroot\acceso.mdb")
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath
("\acceso.mdb"))

Set RS = Server.CreateObject("ADODB.Recordset")

dato = request.form("username")

RS.Open "users", Conn
RS.addnew
	
RS ("username")= dato
RS.update

Conn.Close
Set RS = Nothing
Set Conn = Nothing

%>

I have tried two different providers without good results.
This the error I'm getting:

Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of 
the provider, or of the selected locktype.
/register.asp, line 18


Thanks, 

Wil
Message #2 by "Larry Woods" <larry@l...> on Fri, 22 Nov 2002 07:08:06 -0700
The default cursor for a recordset is "Read Only/Forward Only".

    RS.Open "users",
Conn,adOpenStatic,adLockOptimistic,adCmdTable

(Redo your 'Open' and you will see the options.  I "may" have
spelled something wrong.  Going from memory)

Hope this helps...

Larry Woods


> -----Original Message-----
> From: wilfree_baluja@h...
> [mailto:wilfree_baluja@h...]
> Sent: Friday, November 22, 2002 7:42 AM
> To: Access ASP
> Subject: [access_asp] rs.AddNew doesn't work
>
>
> I have problems to update registers. The following is
> a portion of a very
> simple app, but it doesn't work. I have Access 2000
> working in local
> server with IIS 5.0
>
> <%
> Option Explicit
> Response.Expires = -1000
>
> Dim Conn
> Dim RS
> dim dato
>
> Set Conn = Server.CreateObject("ADODB.Connection")
> 'Conn.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
> + "C:\Inetpub\wwwroot\acceso.mdb")
> Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};
> DBQ=" & Server.MapPath
> ("\acceso.mdb"))
>
> Set RS = Server.CreateObject("ADODB.Recordset")
>
> dato = request.form("username")
>
> RS.Open "users", Conn
> RS.addnew
>
> RS ("username")= dato
> RS.update
>
> Conn.Close
> Set RS = Nothing
> Set Conn = Nothing
>
> %>
>
> I have tried two different providers without good results.
> This the error I'm getting:
>
> Error Type:
> ADODB.Recordset (0x800A0CB3)
> Current Recordset does not support updating. This may
> be a limitation of
> the provider, or of the selected locktype.
> /register.asp, line 18
>
>
> Thanks,
>
> Wil

Message #3 by "Larry Woods" <larry@l...> on Fri, 22 Nov 2002 07:09:37 -0700
Follow Up Comment:

Just noticed that you are in VBScript.  Make your open:

	RS.Open "users", Conn,3,3

> -----Original Message-----
> From: wilfree_baluja@h...
> [mailto:wilfree_baluja@h...]
> Sent: Friday, November 22, 2002 7:42 AM
> To: Access ASP
> Subject: [access_asp] rs.AddNew doesn't work
>
>
> I have problems to update registers. The following is
> a portion of a very
> simple app, but it doesn't work. I have Access 2000
> working in local
> server with IIS 5.0
>
> <%
> Option Explicit
> Response.Expires = -1000
>
> Dim Conn
> Dim RS
> dim dato
>
> Set Conn = Server.CreateObject("ADODB.Connection")
> 'Conn.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
> + "C:\Inetpub\wwwroot\acceso.mdb")
> Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};
> DBQ=" & Server.MapPath
> ("\acceso.mdb"))
>
> Set RS = Server.CreateObject("ADODB.Recordset")
>
> dato = request.form("username")
>
> RS.Open "users", Conn
> RS.addnew
>
> RS ("username")= dato
> RS.update
>
> Conn.Close
> Set RS = Nothing
> Set Conn = Nothing
>
> %>
>
> I have tried two different providers without good results.
> This the error I'm getting:
>
> Error Type:
> ADODB.Recordset (0x800A0CB3)
> Current Recordset does not support updating. This may
> be a limitation of
> the provider, or of the selected locktype.
> /register.asp, line 18
>
>
> Thanks,
>
> Wil

Message #4 by wilfree_baluja@h... on Sat, 23 Nov 2002 07:02:52
Thank you Larry,

I did it the way you said and it it working properly.
Thanks, again.



> I have problems to update registers. The following is a portion of a 
very 
s> imple app, but it doesn't work. I have Access 2000 working in local 
s> erver with IIS 5.0

> <%
O> ption Explicit
R> esponse.Expires = -1000

> Dim Conn
D> im RS
d> im dato

> Set Conn = Server.CreateObject("ADODB.Connection")
'> Conn.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" 
+>  "C:\Inetpub\wwwroot\acceso.mdb")
C> onn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & 
Server.MapPath
(> "\acceso.mdb"))

> Set RS = Server.CreateObject("ADODB.Recordset")

> dato = request.form("username")

> RS.Open "users", Conn
R> S.addnew
	> 
R> S ("username")= dato
R> S.update

> Conn.Close
S> et RS = Nothing
S> et Conn = Nothing

> %>

> I have tried two different providers without good results.
T> his the error I'm getting:

> Error Type:
A> DODB.Recordset (0x800A0CB3)
C> urrent Recordset does not support updating. This may be a limitation of 
t> he provider, or of the selected locktype.
/> register.asp, line 18

> 
T> hanks, 

> Wil

  Return to Index