MSAccess: Select * Into for CSV file in a different PathMS Access 2003/2007 - Import Specification for data import from csv file used in VBA…validate field names?Pull .csv file into Access DatabaseBest Way To Import Multiple Files With Different File Types / Structure?Database links not refreshing properly when a change the windows folder nameImport .csv file to MSAccess table without losing leading zerosDoCmd.TransferText error 3051VBA procedure to import only selected csv files (from one folder) into a single table in accessExtract a CSV from a ZIP file downloaded from the web, then format and import that CSV to AccessUpdating an Access Table with a CSV File AutomaticallyMSAccess - Pre-Select Combobox Row

Can I use my OWN published papers' images in my thesis without Copyright infringment

How to prevent criminal gangs from making/buying guns?

A Magic Diamond

What is the question mark?

When does The Truman Show take place?

Can an international student manage his cost of living in Australia if his 4 years PhD tuition fee is waived off by the university?

Short comic about alien explorers visiting an abandoned world with giant statues that turn out to be alive but move very slowly

What is the opposite of "hunger level"?

Do I need to start off my book by describing the character's "normal world"?

Meaning of だけはわからない

What are the advantages of this gold finger shape?

Understanding a part of the proof that sequence that converges to square root of two is decreasing.

Is there any official ruling on how characters go from 0th to 1st level in a class?

Did Michelle Obama have a staff of 23; and Melania have a staff of 4?

Escape Velocity - Won't the orbital path just become larger with higher initial velocity?

Doesn't the speed of light limit imply the same electron can be annihilated twice?

What is the spellcasting ability of a Barbarian Totem Warrior?

Visa on arrival to exit airport in Russia

What allows us to use imaginary numbers?

How do I ask for 2-3 days per week remote work in a job interview?

Why does Japan use the same type of AC power outlet as the US?

Weird resistor with dots around it on the schematic

What should we do with manuals from the 80s?

Adding things to bunches of things vs multiplication



MSAccess: Select * Into for CSV file in a different Path


MS Access 2003/2007 - Import Specification for data import from csv file used in VBA…validate field names?Pull .csv file into Access DatabaseBest Way To Import Multiple Files With Different File Types / Structure?Database links not refreshing properly when a change the windows folder nameImport .csv file to MSAccess table without losing leading zerosDoCmd.TransferText error 3051VBA procedure to import only selected csv files (from one folder) into a single table in accessExtract a CSV from a ZIP file downloaded from the web, then format and import that CSV to AccessUpdating an Access Table with a CSV File AutomaticallyMSAccess - Pre-Select Combobox Row






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I need to copy CSV data into an Access table. TransferText works as expected, but is much slower than "Select * Into". 500K records, 43 columns (not my data).



The following works as needed, but only when the CSV file resides on the same Path as the database (strPath, in this case).



strFile = "testfile.csv"
strPath = CurrentProject.Path
strPath2 = CurrentProject.Path & "Backend_Data"

strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath & "].[" & strFile & "];"
db.Execute (strSQL)


The CSV file will be landing in strPath2 (Backend_Data). Adding strPath2 to strSQL above, in front of strFile, does not work or complain.



Is this a SQL syntax issue, or do I just need to keep the CSV File in the same Path as the database?










share|improve this question
































    1















    I need to copy CSV data into an Access table. TransferText works as expected, but is much slower than "Select * Into". 500K records, 43 columns (not my data).



    The following works as needed, but only when the CSV file resides on the same Path as the database (strPath, in this case).



    strFile = "testfile.csv"
    strPath = CurrentProject.Path
    strPath2 = CurrentProject.Path & "Backend_Data"

    strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath & "].[" & strFile & "];"
    db.Execute (strSQL)


    The CSV file will be landing in strPath2 (Backend_Data). Adding strPath2 to strSQL above, in front of strFile, does not work or complain.



    Is this a SQL syntax issue, or do I just need to keep the CSV File in the same Path as the database?










    share|improve this question




























      1












      1








      1








      I need to copy CSV data into an Access table. TransferText works as expected, but is much slower than "Select * Into". 500K records, 43 columns (not my data).



      The following works as needed, but only when the CSV file resides on the same Path as the database (strPath, in this case).



      strFile = "testfile.csv"
      strPath = CurrentProject.Path
      strPath2 = CurrentProject.Path & "Backend_Data"

      strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath & "].[" & strFile & "];"
      db.Execute (strSQL)


      The CSV file will be landing in strPath2 (Backend_Data). Adding strPath2 to strSQL above, in front of strFile, does not work or complain.



      Is this a SQL syntax issue, or do I just need to keep the CSV File in the same Path as the database?










      share|improve this question
















      I need to copy CSV data into an Access table. TransferText works as expected, but is much slower than "Select * Into". 500K records, 43 columns (not my data).



      The following works as needed, but only when the CSV file resides on the same Path as the database (strPath, in this case).



      strFile = "testfile.csv"
      strPath = CurrentProject.Path
      strPath2 = CurrentProject.Path & "Backend_Data"

      strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath & "].[" & strFile & "];"
      db.Execute (strSQL)


      The CSV file will be landing in strPath2 (Backend_Data). Adding strPath2 to strSQL above, in front of strFile, does not work or complain.



      Is this a SQL syntax issue, or do I just need to keep the CSV File in the same Path as the database?







      ms-access access-vba






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 12:34







      Mark Pelletier

















      asked Mar 27 at 12:19









      Mark PelletierMark Pelletier

      7811 gold badge13 silver badges29 bronze badges




      7811 gold badge13 silver badges29 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0














          CurrentProject.Path does not have a trailing backslash, so try with:



          strPath2 = CurrentProject.Path & "Backend_Data"

          strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath2 & "].[" & strFile & "];"
          db.Execute (strSQL)





          share|improve this answer



























          • Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

            – Mark Pelletier
            Mar 27 at 13:29












          • Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

            – Gustav
            Mar 27 at 14:54










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377043%2fmsaccess-select-into-for-csv-file-in-a-different-path%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          CurrentProject.Path does not have a trailing backslash, so try with:



          strPath2 = CurrentProject.Path & "Backend_Data"

          strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath2 & "].[" & strFile & "];"
          db.Execute (strSQL)





          share|improve this answer



























          • Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

            – Mark Pelletier
            Mar 27 at 13:29












          • Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

            – Gustav
            Mar 27 at 14:54















          0














          CurrentProject.Path does not have a trailing backslash, so try with:



          strPath2 = CurrentProject.Path & "Backend_Data"

          strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath2 & "].[" & strFile & "];"
          db.Execute (strSQL)





          share|improve this answer



























          • Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

            – Mark Pelletier
            Mar 27 at 13:29












          • Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

            – Gustav
            Mar 27 at 14:54













          0












          0








          0







          CurrentProject.Path does not have a trailing backslash, so try with:



          strPath2 = CurrentProject.Path & "Backend_Data"

          strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath2 & "].[" & strFile & "];"
          db.Execute (strSQL)





          share|improve this answer















          CurrentProject.Path does not have a trailing backslash, so try with:



          strPath2 = CurrentProject.Path & "Backend_Data"

          strSQL = "SELECT * INTO TempItem FROM [Text;HDR=NO;FMT=Delimited(,);Database=" & strPath2 & "].[" & strFile & "];"
          db.Execute (strSQL)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 27 at 14:53

























          answered Mar 27 at 13:07









          GustavGustav

          33.7k5 gold badges22 silver badges37 bronze badges




          33.7k5 gold badges22 silver badges37 bronze badges















          • Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

            – Mark Pelletier
            Mar 27 at 13:29












          • Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

            – Gustav
            Mar 27 at 14:54

















          • Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

            – Mark Pelletier
            Mar 27 at 13:29












          • Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

            – Gustav
            Mar 27 at 14:54
















          Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

          – Mark Pelletier
          Mar 27 at 13:29






          Gustav, strFile = strPath2 & strFile is what I tried & fails. The trailing backslash would be necessary in strPath2,

          – Mark Pelletier
          Mar 27 at 13:29














          Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

          – Gustav
          Mar 27 at 14:54





          Yes, that will fail. Just replace strPath with strPath2 - see extended answer, please.

          – Gustav
          Mar 27 at 14:54








          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







          Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55377043%2fmsaccess-select-into-for-csv-file-in-a-different-path%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript