Closed Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    02-24-2010
    Location
    Veenendaal
    MS-Off Ver
    Excel 2003
    Posts
    2

    Externe data rechtstreeks in een array

    Ik probeer externe data vanaf een paradox db met behulp van ODBC in een excel document te laden en deze rechtstreeks in een array te zetten, dus zonder dat de gegevens getoond worden in de sheet.

    Weet iemand of dit mogelijk is en zo ja hoe?

    Ik laad op dit moment mijn gegevens zo in:

    Code:
    Sub CreateQT()
    
        Dim sConn As String
        Dim sSql As String
        Dim oQt As QueryTable
        Dim testArray As Variant
            
        sConn = "ODBC;DSN=test;"
        sConn = sConn & "DBQ=horderrg.db;"
        sConn = sConn & "Defaultdir=n:\pcs\tables;"
        sConn = sConn & "DriverId=538;"
        sConn = sConn & "FIL=Paradox 5.X;"
        
        sSql = "SELECT * FROM HORDERRG ORDER BY HORDERRG.OrderLine"
        
       Set oQt = ActiveSheet.QueryTables.Add( _
            Connection:=sConn, _
            Destination:=Range("o3"), _
            Sql:=sSql)
    
       oQt.Refresh
       
    End Sub
    Maar dit geeft een foutmelding. Ik krijg de foutmelding "n:/pcs/tables/horderrg.db is geen geldig pad" Terwijl ik honderd procent zeker weet dat het pad klopt en dat ik ook toegang tot die schijf heb.

    Iemand ideeen?

  2. #2
    Forum Moderator dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003 & 2007
    Posts
    3,661

    Smile Re: Externe data rechtstreeks in een array

    This post is a duplicate : http://www.excelforum.com/excel-misc...-an-array.html

    The English version has been left open as it will attract more viewers.

    DominicB
    Now available : Ultimate Add-In 2007
    Integrates directly into the Office Excel Ribbon


    Download Ultimate Add-In v1.52 from www.dom-and-lis.co.uk
    90+ Utilities, 200+ Sub utilities last updated 25th April 2008
    Free!!

Thread Information

Users Browsing this Thread

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

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.2.0