Re: newbie: how to implement vb recordsets in stored procedures
From: William Morris (news.remove.this.and.the.dots_at_seamlyne.com)
Date: 02/16/04
- Next message: William Morris: "Re: Using expressions in a SELECT Clause"
- Previous message: SND: "Re: how to scramble data in a table"
- In reply to: Joost: "newbie: how to implement vb recordsets in stored procedures"
- Next in thread: Louis Davidson: "Re: newbie: how to implement vb recordsets in stored procedures"
- Reply: Louis Davidson: "Re: newbie: how to implement vb recordsets in stored procedures"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Feb 2004 09:49:50 -0600
For the example you've posted, a simple update statement will give you what
you want.
UPDATE table1
SET field3 = 1
WHERE field1 > 0
AND field2 > 0
If you're going to work in SQL you'll want to stop thinking in procedural
terms. Just about anything you'd want to do can be accomplished with SQL
statements of varying complexity without resorting to vb-style coding. Keep
your eyes and your mind open; it's a big mental shift, but once you do
you'll like the efficiency you get.
--
William Morris
Product Development, Seritas LLC
Kansas City, Missouri
<Joost> wrote in message news:%23Upy9AK9DHA.1936@TK2MSFTNGP12.phx.gbl...
> Hi group,
>
> Can sombody give me some pointers in how to convert visual basic code with
> recordsets to a stored procedures.
>
> For example: how should i implement the following.
>
> Set rs = CurrentDb.OpenRecordset("SELECT * FROM Table1 WHERE KeyField="
&
> mId)
> rs.Edit
>
> If rs!Field1 > 0 And rs!Field2 > 0 Then
> rs!Field3 = 1
> End If
>
> rs.Update
> rs.Close
>
> Please understand that this is only a short example. I have lots of lines
of
> visual basic code thes way that specify the business rules.
>
> Any help is highly appreciated.
>
> Joost.
>
>
- Next message: William Morris: "Re: Using expressions in a SELECT Clause"
- Previous message: SND: "Re: how to scramble data in a table"
- In reply to: Joost: "newbie: how to implement vb recordsets in stored procedures"
- Next in thread: Louis Davidson: "Re: newbie: how to implement vb recordsets in stored procedures"
- Reply: Louis Davidson: "Re: newbie: how to implement vb recordsets in stored procedures"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|