Re: NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset
From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 03/30/04
- Next message: Dave: "RE: How do I add an index to a FoxPro table"
- Previous message: Alain Beaulieu: "NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- In reply to: Alain Beaulieu: "NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- Next in thread: Alain Beaulieu: "Re: NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- Reply: Alain Beaulieu: "Re: NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 29 Mar 2004 17:31:46 -0800
Nope. The code engine that interprets the SQL is included in SQL Server,
JET, Oracle etc. ADO is simply an layer/interface to that engine.
There is nothing to stop you from writing your own SQL interpreter... but
I'm not sure how productive that would be.
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Alain Beaulieu" <abeaulieu@montreal.ds.adp.com> wrote in message
news:a79ff28e.0403291722.5ee1f3fa@posting.google.com...
> Hi all,
>
> I VERY often create a disconnected recordset in code from scratch,
> with no database connection, and with no intention to connect either
> (for sorting, for example). What I want to do here for the first time
> is issue an UPDATE "statement" on the recordset itself. Here is an
> example:
>
> Dim oRecordset As Recordset
> Set oRecordset = New Recordset
>
> oRecordset.Fields.Append "Name", 200, 255
> oRecordset.Fields.Append "Age", 200, 255
> oRecordset.Open
> oRecordset.AddNew
> oRecordset("Name") = "Bob"
> oRecordset("Age") = "34"
> oRecordset.Update
>
> oRecordset.AddNew
> oRecordset("Name") = "Brian"
> oRecordset("Age") = "35"
> oRecordset.Update
>
> oRecordset.AddNew
> oRecordset("Name") = "Bill"
> oRecordset("Age") = "41"
> oRecordset.Update
>
> oRecordset.Sort = "Age Desc"
> oRecordset.MoveFirst
>
> Do While Not oRecordset.EOF
> 'some code here...
> oRecordset.MoveNext
> Loop
>
> I would like to know if I can do an UPDATE on the recordset itself,
> somehow? For example:
>
> UPDATE *WHATEVER* SET AGE = 40 WHERE AGE > 40
>
> This would translate into something like:
>
> oRecorsdset.*SomeUpdatingMethod* = "Age = 40 WHERE Age > 40"
>
> Can I do this? If so, how? (I don't think so, but I want confirmation
> --> I've done a lot of research and I'm used to the Recordset object)
>
> I know I can do a loop and update the records individually, but the
> point here is that I want to use an UPDATE statement that the
> recordset would somehow interpret.
> Thanks.
- Next message: Dave: "RE: How do I add an index to a FoxPro table"
- Previous message: Alain Beaulieu: "NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- In reply to: Alain Beaulieu: "NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- Next in thread: Alain Beaulieu: "Re: NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- Reply: Alain Beaulieu: "Re: NOT YOUR STANDARD QUESTION: SQL UPDATE in Disconnected Recordset"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|