• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SQL database and applescript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SQL database and applescript?


  • Subject: Re: SQL database and applescript?
  • From: Ray <email@hidden>
  • Date: Thu, 04 Apr 2002 15:33:59 -0800

Jeff, you definitely get a gold star for creative computing!

I'd like to mention a couple of issues I've found in dealing with ODBC. First, it's really slow if you need to access more than a few records at a time. Second, Macintosh ODBC drivers are not
available for some databases (like MySQL).

If anyone knows where MySQL ODBC drivers for OS9 can be found, please post it to the list.



>
>
> Message: 1
> From: email@hidden
> To: email@hidden
> Subject: Re: SQL database and applescript?
> Date: Thu, 4 Apr 2002 11:29:45 -0500
>
> Sorry for the lateness of this, but I figured I would throw it out there
> just in case...
>
> I too feel your pain. However, I've successfully used 2 methods for doing
> SQL from AppleScript for free (or free if you own Microsoft Excel) with not
> too much dependency on middleware (or at least middleware that's not already
> likely to be around in a "Microsoft shop") for the last couple of years. For
> instance, I have a script that uses Photoshop to save out JPEG versions of
> print images, copies them to a server, and then updates our photo database
> with info about each JPEG.
>
> Basically, the methods I have used are:
>
> 1) Use Microsoft Excel for Mac. Set up a worksheet with a QueryTable to use
> as the scriptable go-between for your script and the SQL database. Make sure
> to install the "data access" components, and you'll need an ODBC driver for
> your database. I used the one included with Office 98 for SQL Server, but
> this was recently updated for SQl 7.0 and 2000 -- check
> http://www.microsoft.com/mac/DOWNLOAD/OFFICE2001/XLDataAccess.asp.
> Basically, you can change the SQL attribute of the QueryTable via
> AppleScript, then tell the QueryTable to Refresh. This will execute your SQL
> and return results into the area of the worksheet that display the
> QueryTable. The downside with this approach is that you have to set up a DSN
> on each Mac, I believe.
>
> 2) Use an ASP page on a local intranet server and communicate with it using
> URL Access from your script. It's fairly easy to write a generic ASP page
> that takes a SQL string as a form element and executes it against a database
> server, returning the results as an HTML file. Your script then has to parse
> that file to get any results you want back from the SQL server. But if it's
> a small operation, this is pretty quick using file read/write commands. One
> issue with this approach is security -- for the script to be able to post to
> that ASP without user interaction, the ASP must be using an anonymous
> account. Which means you're leaving an ASP out there on your intranet that
> will blindly execute any SQL thrown at it. So make sure that the SQL login
> that the ASP uses is relatively harmless to other data on your sever.
>
> I can explain more if needed.
>
> Jeff Sternberg
> Crutchfield Corporation
> http://www.crutchfield.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: SQL database and applescript? ?++
      • From: Lars DeRuntz <email@hidden>
    • Re: SQL database and applescript?
      • From: Giuliano Gavazzi <email@hidden>
  • Prev by Date: URL Access Scripting misbehavior?
  • Next by Date: Re: SQL database and applescript?
  • Previous by thread: Re: SQL database and applescript?
  • Next by thread: Re: SQL database and applescript?
  • Index(es):
    • Date
    • Thread