+ Reply to Thread
Results 1 to 5 of 5

Import .csv to DB2 automatically

  1. #1
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Import .csv to DB2 automatically

    Hello everyone,

    I have a .csv file that needs to be imported into a IBM DB2 table. I can import .csv data manually, but I want to do It automatically with VBA, If possible.

    I have found some VBA code that might work, but cannot set It right, or It isn't what I think It is.

    Code:

    Please Login or Register  to view this content.
    When I run the code I get an error "[IBM][CLI driver] SQL1337N The service "<50000>" was not found" !

    I don't know about OLE DB or ODBC driver - as instructed, I should have one installed on local machine, but can't find anywhere how to download It.

    Also, when I use Data>Import External data>Import Data tool in Excel, I can connect to DB2 database directly from Excel, so maybe ODBC driver allready installed ??

    My version of DB2 is Express-C 10.5, and Excel 2003.

    I'm not sure either If red coloured line of code is basically an SQL command or db2cmd command (which I need exactly as written - I need to import .csv into specific table called "razpored")


    I know this is probably a tough question, but can somebody please help me ?
    Last edited by Lukael; 10-04-2014 at 12:53 PM.

  2. #2
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Import .csv to DB2 automatically

    Bump, no answer.

    Can at least somebody tell me If this is even possible - to export .csv via ODBC in VBA ?

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Import .csv to DB2 automatically


    Hi,

    don't know but check on http://www.connectionstrings.com/

  4. #4
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Import .csv to DB2 automatically

    Thanks,

    I checked, looks like my connection to DB2 is o.k., problem is just that red coloured line of code, for importing .csv to DB2. Got any clues on how to solve that ?

  5. #5
    Forum Contributor
    Join Date
    02-09-2014
    Location
    Kamnik, Slovenia
    MS-Off Ver
    Excel 2010
    Posts
    693

    Re: Import .csv to DB2 automatically

    Problem solved, I just needed to run code from ADMIN_CMD.

    For everyone who wiil need this code in future:

    Please Login or Register  to view this content.
    And be very careful with charachers when writing QUERY commands
    Last edited by Lukael; 10-08-2014 at 10:33 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. I need a Macro to automatically import web pages
    By Bret1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2013, 05:56 PM
  2. Automatically import XML into excel using vba
    By JCampos081 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2012, 11:04 PM
  3. Import Automatically Pictures
    By leturc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2012, 06:11 AM
  4. automatically import a file
    By boomshank in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2009, 09:43 AM
  5. can I automatically import .csv file?
    By jaspittman in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-11-2008, 02:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1