PDA

View Full Version : Data Driven VBP ???


posix337
06-09-2005, 11:07 AM
Hello!

We are in a process of converting our CD production processes into a data driven automated solution.

We have a database (SQL Server) that contains a list of file locations in Perforce. This is on the order of ~500 files.

We would like to query the database and somehow loop through Perforce Sync command steps, however we have not found a good way to do this without resorting to using vbscript and the Perforce COM object...

So, we've solved this for SYNC commands however in the near future I will have to come up with solutions that pull data from a database, build vb projects, copy, and zip files... etc... All of the things VBP is good at.

I hate to think of the amout of work to do all of this in script, it would nearly eliminate the usefulness of VBP. ( I might as well write it all in a program or script).

So, I guess what I really need is an example of querying a database into a recordset or something similar, and looping through VBP steps using the data from the query..

Any help in this area would be greatly appreciated... VBP has been a tremendous help in our automation needs,.

Thanks all!

kevina
06-09-2005, 10:16 PM
Attached is a quick sample using subroutines, a Run Sql step and vbscript that loads data queried from Sql Server into a delimited macro. It also demonstrates how you can then use regular Visual Build Professional steps to do the actual work using this dynamic data.

While the design is fairly modular and generic you will probably need to modify it some for your particular situation/needs.

posix337
06-13-2005, 03:51 PM
Thanks for the sample script, I knew there had to be a way to do this!

I will attempt to make this work for our solution, it certainly looks promising.

Will post back here to let you know how it goes.

posix337
06-14-2005, 11:27 AM
Ok, I have this script working, however I have come up with a couple of questions.

What is the size limit of the Macro LASTSTEP_OUTPUT? I see that it is holding the result of the query.

A corresponding question would be, what is the size limit of the DB_VALUES macro (or I guess any Macro)

Most likely, the generic form of this question should be:
What is the size limit of a macro...

kinook
06-14-2005, 12:51 PM
The limit is the maximum length of the BSTR data type (~4 billion chars). In practice, this may be limited by the available memory on your system.