Hi again,
The best place that I know of to find code examples is in the MS Query help
files. These help files are an extra install from the Value Pack installer
on the Office install CD. They are active when you are running MS Query.
Another good source of code samples is Excel itself. Turn on the Macro
recorder in Excel 98 and then connect to a database. (The Macro recorder
will not work in Excel 2001 or later). The code will work the same for both
Excel 98 and 2001.
Another source is to use Google to search for examples.
Look on the install CD of Office 98, (but not 2001), for the ODBC drivers.
This link has additional information about installing the ODBC drivers:
http://www.agentjim.com/MVP/Excel/ODBC/XL2001odbc.htm
The ODBC drivers from Office 98 will work with Office 2001.
The SQL Server driver is quite dated. If you're looking for something newer
try OpenLinks
http://www.openlinksw.com/
In my previous posting I forgot to mention that you can use SQLExecQuery
commands. There are also commands to bind the results to map to specific
columns should you desire to do so.
-Jim Gordon
Mac MVP
All responses should be made to this newsgroup within the same thread.
Thanks.
About Microsoft MVPs:
http://www.mvps.org/
Search for help with the free Google search Excel add-in:
<
http://www.rondebruin.nl/Google.htm>
----------
Dear Jim
Many thanks for the prompt reply and valuable advice.
I always thought DDE commands were Windows only, but obviously not.
Is there any place I can obtain help files and examples on all this, as the
MS Query help that I have on offer to me in Excel 98 and 2001 for Mac don't
come anywhere close on this.
Finally, how does the DSN come in on DDE so that you can connect and query
such as SQL database data?
Many thanks.
Rgds
Laphan
Hi
If you want to use anything that involves Active-X the answer is "no."
However, there is still a lot you can do programmatically. The MS Query help
file offers plenty of examples under the topic DDE Commands.
Here is one of the help file examples
This statement uses an SQL SELECT statement to execute a new query.
DDEExecute chan, "[Open(""SELECT * FROM pubs.dbo.titles"")]")
The vocabulary and syntax are not always the same between Windows and Mac -
particularly when dealing with file paths (of saved queries). The Mac
directory delimiter is the colon, not a slash.
You should be able to do just about anything you want. All of SQL is
available. You can open and close channels and map the results to columns in
Excel. You can create and execute parameter queries. You can bring the
result set into columns and I think pivot tables as well. You can put the
data into arrays in VBA and manipulate to your heart's content.
-Jim Gordon
Mac MVP
All responses should be made to this newsgroup within the same thread.
Thanks.
About Microsoft MVPs:
http://www.mvps.org/
Search for help with the free Google search Excel add-in:
<
http://www.rondebruin.nl/Google.htm>
----------
Hi All
Tall order, but is it possible to use the ADO commands that you can in say
ASP, eg Recordsets, Connections, etc in Excel 98/2001?
I know you can manipulate SQL queries in VBA, but the Mac versions don't
seem to have anything like this functionality like the PC version has - am I
incorrect?
Rgds
Laphan
[/QUOTE]
[/QUOTE]