Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Importing data from Oracle server via ODBCto Excel on a mac?
I've done this in Windows often enough but haven't tried it on a Mac. Excel VBA on Windows uses ADO to access ODBC. If that's available on the Mac, you would open a connection to your Oracle server and then create a recordset (by passing a SQL statement to retrieve the data). Once you have a recordset, you can loop through it and populate your spreadsheet.
chuck
|| Chuck Hinkle [INTJ] || CLH WAREs || chuckbo_at_mac.com || <http://homepage.mac.com/chuckbo/> || || "Perception is usually more persuasive than reality." ||
My internet radio station is at:
http://www.live365.com/stations/152652
> From: mrl_at_psfc.mit.edu (Mark London)
> Organization: MIT Plasma Science and Fusion Center
> Newsgroups:
> comp.sys.mac.databases,microsoft.public.excel.macintosh,comp.databases.oracle.
> misc
> Date: 26 DEC 2001 15:26:51 GMT
> Subject: Importing data from Oracle server via ODBCto Excel on a mac?
>
> I am trying to download data to an excel spread sheet on a mac from an Oracle
> server accessed via ODBC. I want to code this into Visual Basic code and pass
> the SQL command to the server. I am using the Merant ODBC version 3.51
> software, which I've installed a demo version on my mac. I can access the
> server using Microsoft Query, so I know at least that works, but I can't find
> any commands in Visual Basic that properly works. Has anyone actually done
> this, and what method did you use?
>
> I first tried to use SQLOpen and SQLExecQuery commands. The SQLOpen prompts
> me for username and password, but the SQLExecQuery command returns an error,
> and when I use SQLError, it gives me an error IMO001, with a message
> indicating that the SQL driver manager does not support this function. (FWIW,
> the same commands do work with local non-Oracle ODBC accessed database.)
>
> Since Microsoft Query works, I decided to try and use DDE to access the data
> via Microsoft Query, i.e.:
>
> Chan = DDEInitiate("MSQuery", "System")
> DDEExecute Chan, "[ODBCLogon('xxxxxx',1)]"
>
> Chan is successfully filled with a connection number, but the next command
> doesn't work at all, as it returns an error 2023. Note that I can't even get
> this to work with local non-Oracle databases either. I tried both ODBCLogon
> and the simple Logon command.
>
> Thanks very much.
>
> Mark London
> MRL_at_PSFC.MIT.EDU
Received on Wed Dec 26 2001 - 11:26:15 CST