Skip to main content
January 17, 2014
Answered

Can I import data from a database into a FrameMaker document using ExtendScript?

  • January 17, 2014
  • 2 replies
  • 2046 views

I want to import part information from a database into a structured (XML) FrameMaker document. The document would be an Illustrated Parts Catalog, built by merging the text in the structured document with graphic files and nomenclature stored in a database. Can ExtendScript do this, or do I need to investigate a different language for this programmatic approach to building a document?

This topic has been closed for replies.
Correct answer frameexpert

There is no direct way to connect to a database with FrameMaker ExtendScript. It is possible to write C++ code to interact with scripts, so you could write some kind of connector in C++ that would work with ExtendScript. ExtendScript can work with XML files, so another alternative would be to export your data from the database to XML and use ExtendScript to parse and import it to FrameMaker.

I would take a serious look at FrameScript. FrameScript has built-in ODBC support so you can connect directly to your database and use SQL queries to get your data into FrameMaker. It also has ActiveX support, so you can use ADODB technology to get data from your database. I have done database import in a bunch of my scripts over the years. Please let me know if you have any questions or comments. --Rick

2 replies

Arnis Gubins
Inspiring
January 18, 2014

Wayne,

Another route that you might want to consider is Datazone's Miramo Personal Edition. This tool was designed just for this type of operation.

See: http://www.miramo.com/english/overview/dp_download.html

I use it to create catalogs, directories and all sorts of other database driven publications.

You might want to also see this thread for additional info: http://forums.adobe.com/thread/1380660?tstart=0

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
January 17, 2014

There is no direct way to connect to a database with FrameMaker ExtendScript. It is possible to write C++ code to interact with scripts, so you could write some kind of connector in C++ that would work with ExtendScript. ExtendScript can work with XML files, so another alternative would be to export your data from the database to XML and use ExtendScript to parse and import it to FrameMaker.

I would take a serious look at FrameScript. FrameScript has built-in ODBC support so you can connect directly to your database and use SQL queries to get your data into FrameMaker. It also has ActiveX support, so you can use ADODB technology to get data from your database. I have done database import in a bunch of my scripts over the years. Please let me know if you have any questions or comments. --Rick

January 17, 2014

Thanks, Rick. I should mention that this would not be a "one-and-done" import of data. Specifically, each time we publish the IPC, our current product's publishing engine merges the data from the database with the document to produce the output. The code would have to be executed each publishing run. Can FrameScript handle that?

frameexpert
Community Expert
Community Expert
January 17, 2014

Absolutely. You would either have to specifically run the script whenever the data changes, or you could have the script automatically run when you open a particular document.