473,322 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Import csv into access table to update values

Hi All,

I'm looking for code to get me started (i can work out the niggles myself) as i've no idea where to start.

I have a table say, ID, Bookname, Quantity.

I want to import a CSV file containing Bookname, Quantity where the quantity in the CSV will decrement the quantity in the table. I expect some kind of loop to cycle though the rows in the csv but not sure of the syntax, especially the connection to a csv.

Regards,
Nov 1 '11 #1
2 4822
NeoPa
32,556 Expert Mod 16PB
We don't do your code for you (We can help when you've shown what you've achieved yourself.) but here's the basic logic you can follow to start yourself off with :
  1. Start with a table definition that matches your CSV file.
  2. Clear the table before each run is processed.
  3. Import the data into this table.
  4. Use an UPDATE query to update your main table from the CSV table (applying subtractions for matching [BookName]s).
Nov 2 '11 #2
ADezii
8,834 Expert 8TB
  1. Is the [ID] Field in your Table Unique?
  2. What is your Table Name?
  3. Does the *.csv File consist of IDs, Book Names, and Quantities?
  4. Do the IDs in the *.csv File, if they exist, match the IDs in the Table?
  5. Does the 1st Row in the *.csv File contain Field Names, and if so what are they?
  6. What is the Logic as to how are the Quantities in the *.csv File to decrement the Quantities in the Table?
Nov 2 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Katuil Katuil | last post by:
Hello All: Have a problem that I have never seen before and have not found anything on technet on how to resolve it. I have a SQL Server 2000 server that I have created a new database. I then...
6
by: Paul | last post by:
I was wondering if anyone has had an issue where using vba code to read an excel file and import the data into an access table some records are not imported from the excel file. It seems looking at...
1
by: JH | last post by:
I have a comma delimited file and I want to export it to an MS access table already designed with appropriate field names. How do I do this programmatically using VB.NET or C#? Thanks for any...
7
by: aaron.kempf | last post by:
team so i have a nice little list in sharepoint.. about 15k items i've got the simplest little join statement in access; and im trying to UPDATE the sharepoint list via an access query. so...
9
by: Shivam | last post by:
Hi All, I have a mysql dump file... something like. __________________________________________________ CREATE TABLE nation ( ip int(11) unsigned NOT NULL default '0', country char(2) NOT...
1
by: winzy | last post by:
I have a table in Access which needs updating from an Excel file. Instead of importing the whole Excel like a new table in Acess, how do I do a partial import/update?? For example, Access table...
2
by: ruthboaz | last post by:
Hi, I am exporting a table with data to an excel file.. Some fields are empty in the exported file while the others and the key field, has values. The empty field(s) in excel, will be entered...
15
by: OfficeDummy | last post by:
Hello all! I searched the Internet and this forum for a similar problem, but I found no help... Also, I'm a complete newbie to the fascinating world of programming, VBA and Access, so my question...
2
by: AccessHunter | last post by:
Please advice me on this. I need to create a new access database that will used to collect the employee hours from various locations. Every friday supervisors from various locations will be sending...
12
by: anand padia | last post by:
I have a master access table where we store all the employee information. I have various application developed in excel which imports and uses information in master. Now I want to develop a excel...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.