473,847 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP: duplicated info when re-reading Access db Tables

VB.net 2003 c/w Framework 1.1 and MS Access db

We have a commercial program that does our Acounting and Time Sheets
(Timberline). At least once a day our Accounting department runs a Script
file that Exports info into an MS Access db file and which has 7 Tables (stuff
like Project info, Project numbers, User names, etc).

I wrote a Time Sheet entry application to read this info and to allow
Employees to write their Time Sheet data into another MS Access db that gets
Imported back into Timberline...al l works fine.

I then wrote another application that I read the Timberline exported file
(that has 7 Tables) and build a new Access db into a Single Table (I do this
to simply speed up my Time Sheet application as there is at least a 2-3 second
load hit for each Table that I have to read when my application starts). This
'update' application runs on my PC and every few minutes checks for an updated
Timberline Export and then creates my single table db. I basically read each
table and dump the info into an Array... then write the Array to a new db

Now my update application sort of works fine. I've found out that it will
work flawlessly the FIRST time it does an update... but in subsequent updates
the 7 Tables Data appears to multiple. In other words, the first time, say
there is User "A"... the second time the update happens, User "A" is shown
Twice, etc.

I've tried figuring out what happens and the only thing I can think of is that
somehow the application is re-reading the table info while keeping previous
table info in memory... IF SO... how do I 'CLEAR' out the 7 tables from memory
before I re-read the updated info???? I've tried closing the Connection for
the 7 tables file but that doesn't appear to work...

Here is some of my applicable Code:

In an UPDATE data adapters and schema's are done (7 of them) --- I used the
Wizard to open my Connections and Db files, etc.

' Master Category Table

' Master Cost Code Table
' Select ONLY Current Codes (having Boolean as 0)
daMstrCode.Sele ctCommand.Param eters(0).Value = 0
Then each table info is put into an Array (one sub-routine per table for ease
of programming):

Private Sub MstrCat()

TextBox3.Text = DsMstrCat.MASTE R_JCM_STANDARD_ CATEGORY.Rows.C ount

If TextBox3.Text > ArraySize Then
ArraySize = TextBox3.Text
ReDim Preserve ProjArray(16, ArraySize)
End If

Dim dtDataTbl As DataTable = DsMstrCat.MASTE R_JCM_STANDARD_ CATEGORY

' Get Info from Data Base
For cntr = 0 To DsMstrCat.MASTE R_JCM_STANDARD_ CATEGORY.Rows.C ount - 1
Dim dr As DataRow = dtDataTbl.Rows( cntr)
ProjArray(9, cntr) = dr("category")
ProjArray(10, cntr) = dr("description ")
Next ' cntr

End Sub
Then I write the Array to my new 1 Table db --- I'm currently writing each
line (about 450 lines) to my db one at a time as I thought that was the

For cntr = 0 To ArraySize - 1
' Open Connection and ADD New Data
OleDbConnection 1.Open()

With DsDataUpdate.Ta bles("TSUpdate" )
Dim NewDr As DataRow = .NewRow
NewDr("Employee ") = ProjArray(0, cntr)
NewDr("Employee _Name") = ProjArray(1, cntr)
NewDr("Class") = ProjArray(2, cntr)
NewDr("Chargeou t_Level") = ProjArray(3, cntr)
NewDr("Pay_ID") = ProjArray(4, cntr)

NewDr("Employee 1") = ProjArray(5, cntr)
NewDr("Pay_Type ") = ProjArray(6, cntr)
NewDr("Pay_ID1" ) = ProjArray(7, cntr)
NewDr("Amount") = Val(ProjArray(8 , cntr))

NewDr("category ") = ProjArray(9, cntr)
NewDr("Descript ion") = ProjArray(10, cntr)

NewDr("Cost_Cod e") = ProjArray(11, cntr)
NewDr("Descript ion1") = ProjArray(12, cntr)
NewDr("Group_Co st_Code") = System.Convert. ToBoolean(ProjA rray(13,

NewDr("Job") = ProjArray(14, cntr)
NewDr("Descript ion2") = ProjArray(15, cntr)
NewDr("Status") = ProjArray(16, cntr)
.Rows.Add(NewDr )

End With

' Send Changes to DataBase and Disconnect
daDataUpdate.Up date(DsDataUpda te, "TSUpdate")
'Carry out your code to do stuff to database here...
Catch dbEx As System.Data.Ole Db.OleDbExcepti on
MessageBox.Show (dbEx.Message)
End Try
OleDbConnection 1.Close()

' Next Line
Next cntr
Then I clear all my variables:

' Reset Variables
Erase ProjArray
cntr = 0
cntrA = 0
ArraySize = 0
fd1 = ""

Nov 21 '05 #1
1 1576
Mr. B.

I thought that the most change for the problem you have is when you don't
have the primary key in your schema.

Just my thought,

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: onTilt | last post by:
Hi, I have few questions and doubts,so please help: Is it true that Runtime class holds runtime information on all objects? Is it true that a subclass has more, or equal amount of functionality when compared to its superclass? When i am checking two objects for equality, what are four
by: Mirek Rusin | last post by:
....what is the best way to force duplicated unique or primary key'ed row inserts not to raise errors? duplicated rows can be ignored or updated as well - it really doesn't matter. to be specific, i've got: $ psql -d mydb -c "copy mytable from 'mytable.tsv'
by: TeknoCat | last post by:
Hey everyone, I may be repeating myself here, but if someone sent a reply then I missed it, and I can't get Outlook Express to download any messages more than 2 days old. Anyway, I'm having a problem with some new pages I am creating for the Web site at www.weaverdevore.ca and I am wondering if anyone here might be able to help. Here is a full description of the problem:
by: Eric Chaves | last post by:
Hi Folks I'm tryingto use the EventLog class to wrote info on my own log (ie, not in Application). If I use the same text for Source and LogName, everything goes right. If I try to use asource that already exists, but it's registered with Application, I got an error telling me that I can't use it with my Log, and if I do create a new source, associeted with my log, the new source is registered ok, and WriteEntry function returns ok, however...
by: Shapper | last post by:
Hello, I have a third party control in my page. I need to set the properties of Labels and Images in this control when: 1. User enters the Page. 2. A button is clicked which changes culture (Change Properties) Usually I would do it this way: Sub Page_Load(...)
by: One Handed Man [ OHM ] | last post by:
If this is duplicated, I'm sorry because I cant find the original post I made today Anyway . . Now its my turn to ask a question I want to develop an app which will run in the system tray. How can I do this?
by: Olivier Bonneau | last post by:
Hello, I have a MDI application. when I have a few MDI children open, and then close one of them, the ControlBox for the MDI children becomes duplicated, right next to one another in the far upper right hand corner, below the ControlBox for the MDI parent. It has the appearrance of Minimize, Maximize, Close, Minimize, Maximize, Close(except it looks like the Underscore, Line at top of box, Capital X duplicated). Do u know how to...
by: ste | last post by:
VS2005, .NET2 I have a dll that is using TraceSources with no problems. The dll is linked to a webservice. The webservice creates its own traceSource and every thing looks fine.. however whenever i try and call a TraceEvent, TraceData method nothing gets called. Looking at the dissasembly, it is easy to see why.. no code has been
by: hzgt9b | last post by:
Using VS 2003, .NET: I developed a windows application that performs several actions based on an input file. The application displays a progress bar as each action executes. Based on new requirements, this application needs to be able to shell off other processes and wait while in the mean time displaying a progress bar of the process's. I am using the System.Disgnostics.Process class to "start" and "waitForExit" of these processes... I...
by: matpac4 | last post by:
I'm a bit stuck! Please can someone help. Here's what I'm trying to build: 1. Webform which puts variables into a database (each with unique ID field) 2. Webform also allows attachment which uploads the file to specific directory 3. On submission of webform for a file on the directory to be duplicated and renamed "unique ID".php and placed in a specific folder
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.