"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:u0XtV%2381DHA.3196@TK2MSFTNGP11.phx.gbl...[color=blue]
>
>
> --
> Aaron Bertrand
> SQL Server MVP
>
http://www.aspfaq.com/[color=green][color=darkred]
> > > DON'T use a recordset and a cursor to perform UPDATEs.
> > >
http://www.aspaq.com/2191[/color]
> >
> > I'm going phucking mad[/color]
>
> Because you didn't read the article. Grow up and stop swearing like a kid
> at recess.
>[color=green]
> > set conn = server.CreateObject ("ADODB.Connection")
> > conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data[/color]
> Source=c:\dataset213.mdb"[color=green]
> >
> > set rs = server.CreateObject ("ADODB.Recordset")
> > rs.CursorType = 3
> > rs.locktype = 3
> > newdate = dateadd("d",-365,date) 'because I need an old date
> > strsql = "UPDATE usersdata SET Creation_date = " & newdate & " WHERE
> > Creation_date IS NULL"
> > rs.open strsql, conn[/color]
>
> Once again. Don't use a recordset to affect data. Recordsets are for
> *reading* data. Also, you need to delimit your date correctly.
>
> How about this.
>
> set Conn = CreateObject("ADODB.Connection")
> conn.open "Provider=Microsoft ... "
> newdate = dateadd("d",-365,date)
> strsql = "UPDATE usersdata SET Creation_date = #" & _
> newdate & "# WHERE Creation_date IS NULL"
> conn.execute(sql)
>[color=green]
> > UPDATE users SET Creation_date = 10/01/2003 WHERE Creation_date IS NULL[/color]
>
> This will try to set the date to 10 divided by 1 (10), divided by 2003[/color]
(some[color=blue]
> very small number).
>[color=green]
> > I'm getting very frustrated now, been on this since 6 and it's now[/color][/color]
nearly[color=blue][color=green]
> > 9:30!![/color]
>
> If you read the articles posted to you, and spend time reading tutorials
> instead of diving into things you know little about, you might have better
> luck, instead of having a big temper tantrum.
>
>[/color]
Aaron,
my sincere apologies.
I was just very frustrated last night after looking at something which
appeared to be right but wasn't and not having the skill to work it out.
thank you for your help and patience
Alistair