Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2011
    Posts
    3

    Unanswered: Excel and DB2 connectivity

    Hi,

    I am very new to Db2 and also VBA to an extent. Could somebody help me out with below request.

    I request somebody to help me with a sample code....

    Basically i have to check using CLI/ODBC driver if the connection between excel and DB2 has been established or not.

    For that i plan to write a batch file where i will be calling the excel sheet which in turn will automatically execute a macro which will bring out some dummy data from sysibm.sysdummy1 table.

    I require a code with which I can make a connection to my database and check if the connection has been established or not....(Probably with some explanation like code breakdown @ important palces)


    Please help me with this request.. Thousand thanks in advance....

    I am not very sure If I posted in the right place.. My Apologies If I had posted in wrong forum..

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

  3. #3
    Join Date
    Aug 2011
    Posts
    3

    hi ni , thanks for a quick response

    i needed some clarifications on the thing .

    first of all i have already created a DSN using odbc connection tool in control panel. now using this dsn i would like to check if the connection has been established or not ?

    I require a code with which I can make a connection to my database and check if the connection has been established or not by giving out some success message if the connection was established and a failure message if the connection was not established....

  4. #4
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    SOURCE FILE NAME: dbConn.bas is an example for connect/disconnect that can be used..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  5. #5
    Join Date
    Aug 2011
    Posts
    3

    thnx guy

    just a small query .... this is the vba code and it will have to called from the batch file separately ?

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    I have no idea - I am a dba and never using such language - if you can call it that way..
    many entries are available on other forum
    Include external file .BAS in Excel VBA
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

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