Hello guys,
I have an access app which is able to extract some data from specific csv files, to automatically create mdb files and to upload the data needed from the csv file in the mdb table.
I have attached this access app : Nicoboss csv.zip
To run it, you need to :
1.download it.
2.in the same folder where the access app is, create a subfolder named "csv" and another subfolder named "mdb"
3.in the "csv" subfolder, place the A.csv I have attached.
4.run the access app and press "Upload data". After a few minutes, it will create the mdb file required with the data needed.
I need to update this access app so that it can work with a slightly different csv format.
B.csv is the new format I need to process. There is one new column in this csv file : the second one.
The only change I need is that in the current app, the 1st field is the concatenation of the 2 first fields from the A.csv file, using this kind of concatenation : "Field1"&"_"&Field2"
Now I need the 1st field in the access table to be the concatenation of the 3 first fields from the B.csv file : "Field1"&"_"&Field2"&"_"&Field3"
I have tried changing things like :
strValues = "'" & rs1.fields(0).Name & "_" & rs1.fields(1).Name & "_" & rs1.fields(2).Name & "',"
strquery = "Insert into [" & tablename1 & "] values ('" & rs1.fields(0).Value & "_" & rs1.fields(1).Value & "_" & rs1.fields(2).Value & "',"
I am not sure this is good as I don't know anything about VBA, but it sounded logical to me.
Anyway, it's not appropriate or it needs additional changes in the code because when I launch it with the new B.csv file, I get an error where this line is in yellow : strval = Str(rs1.fields(count1 - 1).Value)
And now, I guess it only needs a small change, but I have no idea what I should do... Please HELP ! :-)
Thank you for your help.