Results 1 to 6 of 6

Thread: is it possible?

  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Unanswered: is it possible?

    Hi
    All Member
    I want to multi column queries of excel file in Access.is it possible? tell me bout step by step please.

    excel file link here

    http://www.dbforums.com/showthread.php?t=1631968

    Thanks

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    You need to do a better job of explaining what you want.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Oct 2007
    Posts
    11
    If you mean you want to query an excel file so you can use the data in Access, then yes, it's possible. Excel is actually a database format as well that has it's own database driver that you can use from vba.

  4. #4
    Join Date
    Jul 2008
    Posts
    5

    how can i do?

    Hi

    Mr.meingbg
    thanks for co-opreation. yes you are right.i want to queries excel file in Access but, i don't know how it possible if you have solution on vba code then tell me step by step

    thanks

  5. #5
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Link or import the excel file as a new table.

  6. #6
    Join Date
    Oct 2007
    Posts
    11
    It was a long time ago I did it myself, so I can't get to any code I've done. However, there's two basic approaches: Do it straight via VBA objects, or via database connection. With objects, it would look something like this:

    Code:
    set a=createobject("excel.sheet")
    a.sheets(1).cells(1,2)="hello"
    msgbox a.sheets(1).cells(1,2)
    a.application.visible=true
    To open a file, you could do

    Code:
    a.application.workbooks.add "path_and_filename"
    If you choose to do it this way, you could use the VBA in Excel to see the properties & methods available to you if they won't list in Access VBA.

    With database connections, you could look at

    http://www.connectionstrings.com/?carrier=excel

    for the connection string to use, then use the common VB ADODB.Connection object to connect to an Excel file. Usually when you connect this way, you don't see any table's and cannot read any data from excel until you define data areas (or whatever it's called in english). If you can't find out how to do it in excel, try creating a table over the database connection, that should set it up for you in the excel file.

Posting Permissions

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