PC Review


Reply
Thread Tools Rate Thread

Any Suggestions on how to do a multiple change to data?

 
 
Mr. B
Guest
Posts: n/a
 
      19th Dec 2005
I'm open to suggestions on how to accomplish this easily (VB.net... MS
Access):

I've an MS Access db. It has a column indicating if the row has been Exported
or not (the Column is a Boolean).

What I'm trying to figure out is how to toggle the Boolean flag for several
rows at a time.

For example, if I do a Search for a Week-Ending date (ie a date of
23/12/2005), I would lile to be able (via a button) to toggle all of those
rows with that week-ending date to be 1 (or True).

In my application I can display the selected rows in a DataGrid and make
changes there by using a DataSet and Fill with specific search criteria and
Binding the DataSet to a DataGrid. But I want to know how to do this without
having to manually change _each_ Boolean per row.

Any thoughts much appreciated!

Mr. B
 
Reply With Quote
 
 
 
 
Ralph
Guest
Posts: n/a
 
      19th Dec 2005

"Mr. B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm open to suggestions on how to accomplish this easily (VB.net... MS
> Access):
>
> I've an MS Access db. It has a column indicating if the row has been

Exported
> or not (the Column is a Boolean).
>
> What I'm trying to figure out is how to toggle the Boolean flag for

several
> rows at a time.
>
> For example, if I do a Search for a Week-Ending date (ie a date of
> 23/12/2005), I would lile to be able (via a button) to toggle all of those
> rows with that week-ending date to be 1 (or True).
>
> In my application I can display the selected rows in a DataGrid and make
> changes there by using a DataSet and Fill with specific search criteria

and
> Binding the DataSet to a DataGrid. But I want to know how to do this

without
> having to manually change _each_ Boolean per row.
>
> Any thoughts much appreciated!
>
> Mr. B


--
<response type="generic" language="VB.Net">
This newsgroup is for users of Visual Basic version 6.0
and earlier and not the misleadingly named VB.Net
or VB 200x. Solutions, and often even the questions,
for one platform will be meaningless in the other.
When VB.Net was released Microsoft created new newsgroups
devoted to the new platform so that neither group of
developers need wade through the clutter of unrelated
topics. Look for newsgroups with the words "dotnet" or
"vsnet" in their name. For the msnews.microsoft.com news
server try these:

news://msnews.microsoft.com/
microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.languages.vb.data
microsoft.public.dotnet.framework.adonet
microsoft.public.dotnet.framework.windowsforms.controls
microsoft.public.dotnet.framework.windowsforms.databinding
microsoft.public.vsnet.general
microsoft.public.vstudio.general
</response>


 
Reply With Quote
 
Stephen Howe
Guest
Posts: n/a
 
      19th Dec 2005
> I'm open to suggestions on how to accomplish this easily (VB.net... MS
> Access):


Please don't cross post to non-relevant newsgroups.

microsoft.public.data.ado
microsoft.public.vb.database.ado

are for classic ADO, pre-.NET (and anyone else developing .NET apps: _DONT_
bother posting to these newsgroups)

Stephen Howe


 
Reply With Quote
 
Mr. B
Guest
Posts: n/a
 
      19th Dec 2005
Despit your 'reply' I've posted ADO.net/VB.net questions in these NG's in past
WITHOUT anyone making any static on my POSTS... Thus I'll continue to post
here as I do believe them to be 'relevant'.

B
 
Reply With Quote
 
Mr. B
Guest
Posts: n/a
 
      19th Dec 2005
With Deft Fingers, "Stephen Howe" <sjhoweATdialDOTpipexDOTcom> wrote:

>Please don't cross post to non-relevant newsgroups.


See my above previous message.

B
 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      19th Dec 2005
Hopefully you're prepared to keep being told you're posting inappropriately.

However, you need an Update query for what you're doing.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Mr. B" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Despit your 'reply' I've posted ADO.net/VB.net questions in these NG's in
> past
> WITHOUT anyone making any static on my POSTS... Thus I'll continue to
> post
> here as I do believe them to be 'relevant'.
>
> B



 
Reply With Quote
 
Mr. B
Guest
Posts: n/a
 
      19th Dec 2005
With Deft Fingers, "Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com>
wrote:

>Hopefully you're prepared to keep being told you're posting inappropriately.
>
>However, you need an Update query for what you're doing.


No doubt... but like I said, I've done such posting many time before without
anyone commenting.

But thanks for your tip. I'll see what I can find on that.

B
 
Reply With Quote
 
Stephen Howe
Guest
Posts: n/a
 
      19th Dec 2005
> Despit your 'reply' I've posted ADO.net/VB.net questions in these NG's in
past
> WITHOUT anyone making any static on my POSTS...


You got lucky.

> Thus I'll continue to post here as I do believe them to be 'relevant'.


Believing does not matter you selfish git. The newsgroups _ARE_ for classic
ADO.
There are newsgroups specifically for .NET as you well know, even one
devoted to the datagrid.

I will make sure I dont answer any of your questions.

Stephen Howe


 
Reply With Quote
 
Paul Clement
Guest
Posts: n/a
 
      19th Dec 2005
On Mon, 19 Dec 2005 00:22:53 GMT, Mr. B <(E-Mail Removed)> wrote:

¤ I'm open to suggestions on how to accomplish this easily (VB.net... MS
¤ Access):
¤
¤ I've an MS Access db. It has a column indicating if the row has been Exported
¤ or not (the Column is a Boolean).
¤
¤ What I'm trying to figure out is how to toggle the Boolean flag for several
¤ rows at a time.
¤
¤ For example, if I do a Search for a Week-Ending date (ie a date of
¤ 23/12/2005), I would lile to be able (via a button) to toggle all of those
¤ rows with that week-ending date to be 1 (or True).
¤
¤ In my application I can display the selected rows in a DataGrid and make
¤ changes there by using a DataSet and Fill with specific search criteria and
¤ Binding the DataSet to a DataGrid. But I want to know how to do this without
¤ having to manually change _each_ Boolean per row.
¤
¤ Any thoughts much appreciated!

I don't believe there is a direct way to do this in a DataGrid or DataSet.

About the only method you can use is a SQL Update statement, to change this flag for the rows in the
underlying table of your database, based upon the criteria (Date) you specify. You would then need
to rebuild your DataSet and DataGrid to display the updated rows.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Reply With Quote
 
Branden Johnson
Guest
Posts: n/a
 
      19th Dec 2005
Here is the VB6 version of what you want to accomplish:

Place a button on your form, and name it "cmdUpdate"...

Private Sub cmdUpdate_Click()
Dim sqlUpdate As String
Dim con As New ADODB.Connection
Dim iRecAff As Long

sqlUpdate = "" & _
"UPDATE " & _
"TABLENAME " & _
"SET " & _
"EXPORTED = TRUE " & _
"WHERE " & _
"WEEK_ENDDATE = CDATE('12/23/2005')"

With con
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\MyDatabase.mdb;Persist Security Info=False"
.Open
End With

con.Execute sqlUpdate, iRecAff

If iRecAff > 0 Then MsgBox iRecAff & " records sucessfully updated.",
vbInformation, "Record(s) Update"

con.Close
Set con = Nothing
End Sub



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query with multiple tables won't let me change data. Chrisso Microsoft Access 2 11th Nov 2008 09:08 PM
how to change 1 line of data to multiple rows Daniel M Microsoft Excel Programming 2 25th Sep 2007 12:17 PM
sort multiple columns of data but not change the data location... Possible? ghelwig@gmail.com Microsoft Excel Programming 3 15th Jun 2006 09:15 PM
Re: Can i change data in multiple cells by entering data in only one c Frank Kabel Microsoft Excel Misc 0 3rd Sep 2004 12:57 PM
Change the source data in multiple charts rfogator Microsoft Excel Charting 3 23rd Oct 2003 05:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:52 AM.