Re: Addnew method failed on empty recordset




"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:2p6dnZO1R6Pf8tDanZ2dnUVZ_g2dnZ2d@xxxxxxxxxxxxxxx

"Max" <Max@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:227F59E9-BEC3-4D3E-9721-06FE7908D989@xxxxxxxxxxxxxxxx
Hi i am having table Data with field name code, Data Table is empty,
when i tried to Addnew, Update method through ADO it fails it is not
showing
any records ?

my syntex is

dim i as integer
cn.open path
rs.open "Data",cn,adOpenDynamic, adLockBatchOptimistic

thanx
for i=1 to 100
rs.addnew
rs!code= i
next

Add a line as follows ...
For i=1 To 100
rs.AddNew
rs!code = i
rs.Update ' - Add this line
Next


Oops!
<snipped>
It is also possible that you're not using the correct cursor to have an
"updateable" recordset. You can use the Supports() method to determine
this...
http://docs.sun.com/source/817-2514-10/Ch11_ADO101.html#wp1091178


It is not the cursor but the locktype that has the most effect on
"updateability". And I belatedly noticed your constants are OK. But the
Supports() method is handy if you weren't aware of it before. <g>

-ralph


.



Relevant Pages

  • Re: ASP Error Handling (conn.Open) (ADODB.Connection)
    ... I am trying to make it fail with a proper error message if I ... but the ASP file fails altogether when I do that. ... dim sUser ... Sending a connection string over http to a server? ...
    (microsoft.public.inetserver.asp.db)
  • Re: prov something simple but not obvious...
    ... Type in square brackets. ... This is because Type is a reserved word in Access, ... If it still fails, open the Immediate Window and copy the SQL ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • Re: default constraint
    ... but fails on any attempt to print the Value. ... Public Sub ListSqlProps() ... Dim cat As ADOX.Catalog ... Dim prp As ADOX.Property ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: default constraint
    ... but fails on any attempt to print the Value. ... Public Sub ListSqlProps() ... Dim cat As ADOX.Catalog ... Dim prp As ADOX.Property ...
    (microsoft.public.vb.general.discussion)
  • Re: default constraint
    ... but fails on any attempt to print the Value. ... Public Sub ListSqlProps() ... Dim cat As ADOX.Catalog ... Dim prp As ADOX.Property ...
    (microsoft.public.sqlserver.programming)