How to Import or link CSV with more than 255 columns in ACCESS?

Stoorm

New Member
Joined
Jan 5, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I have a .csv with more than 255 columns (395 exactly), I only need 3 columns but I cannot manipulate the source file manually, that is, I cannot divide it in two.
The columns are: 131, 208 and 282

I have tried to do it by wizard but Access won't let me do it because it has more than 255 columns.
I have tried a thousand ways with vba but have not been successful.

Is there a way to do it with vba?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Have you given consideration to temporarily importing it into Excel first, and deleting all except the columns you need, then saving that and importing that into Access?
You should be able to create VBA code in Excel to do all of that, and you can even call/run the Excel VBA code from Access VBA, if you like.

Otherwise, if you wanted to try to do things in Access VBA, here is how I would probably approach it (in theory):
Use Recordsets in VBA to read the text file. Then write just the columns you want to your Access table.
Something along these lines here: How to read data from csv file and write it into Access Table
 
Upvote 0
Can you simply alter the creation of the csv file at the source so that you only get the columns you need?
EDIT - or import/export csv data into SQL Server where (IIRC) the limit is somewhere around 1000 columns.
 
Upvote 0
Can you post some records or all of the csv? May be possible to read a record into a string and parse the string (totally untested).
 
Upvote 0
Can you post some records or all of the csv? May be possible to read a record into a string and parse the string (totally untested).
Please do NOT try to post a file that large within the context of a reply here!

If you do wish to share the file, please upload it to a file sharing site (like Drop Box) and provide a link instead.
 
Upvote 0
10-4. I wasn't interested in the whole file --just a few records to see if I could read and parse the comma separated data (field) values in a file with more than 255 columns.
 
Upvote 0
Out of curiousity how many rows ... I'm just thinking of one or two ways in vba to add to the thousand you tried that didn't work (I mean of course, one or two ways that would work ;) ). Really the only limitation when working with csv is file size (when the files start getting into the Gigabytes size then they become hard to work with ... but also of course good clean data is a must.
 
Upvote 0
Hello, I have a .csv with more than 255 columns (395 exactly), I only need 3 columns but I cannot manipulate the source file manually, that is, I cannot divide it in two.
The columns are: 131, 208 and 282

I have tried to do it by wizard but Access won't let me do it because it has more than 255 columns.
I have tried a thousand ways with vba but have not been successful.

Is there a way to do it with vba?
I'd be creating a new workbook with a sheet that references those 3 columns and use that?
 
Upvote 0
Bummer. I was really curious about the number of rows too :rolleyes:
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top