+ Reply to Thread
Results 1 to 1 of 1

Excel 2003 XLODBC addin convert to ADO

  1. #1
    Registered User
    Join Date
    04-02-2007
    Posts
    1

    Excel 2003 XLODBC addin convert to ADO

    I am using Excel 2003. I am trying to use a macro to access an ODBC data source in our accounting program. (MS Navision attain 3.6). The financial software comes with a C/ODBC driver and sample office 97 spread sheet that uses the Excel XLODBC addin to retreive data directly from the financials. I want to do this however using Excel 2003. Unfortunately Microsoft have discontinued the addin. The VBA help says to use the MS Activex data library instead (ADO). It doesent privide any examples or help in making the transition. . I am trying to findout the correct functions to use in the ADO library and how to use them to replace the following XLODBC functions. I have attached the full sample macro code with my comments as I traced the macro functionality.

    XLODBC functions to replace -:
    SQLOpen()
    SQLError()
    SQLExecQuery()
    SQLRetrieve()
    SQLClose()

    snipits from the macro
    SIZE="1"][/SIZE]
    SQLConnectionID = SQLOpen("DSN=Sample C/ODBC 32 bit;Option=Integer;Decimal=Decimal",
    Range("ErrorSheet!$D$1"), 2)


    Range("ErrorSheet!$A$1..$C$10") = SQLError()


    SQLExecQuery _
    connectionNum:=SQLConnectionID, _
    queryText:="SELECT ""No."", ""Name"", ""Net Change"" FROM ""G/L Account"" WHERE (""Account Type"" = 0)" + _
    "AND (""Date Filter"" = '.." + Range("Ratios!$B$1") + "')" + _
    "AND (""Department Filter"" = '" + Range("Ratios!$B$2") + "')"+ _ "AND (""Project Filter"" = '" + Range("Ratios!$B$3") + "')" + _
    "ORDER BY ""No."" "

    SQLClose connectionNum:=SQLConnectionID

    Thanks for any pointers
    Mike Drummond
    Attached Files Attached Files

+ Reply to Thread

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.6.0 RC 1