Using Xml As A Source For The Connection String 关注

0
Avatar
Legacy Poster

Hi

 

Can anyone help, I want  to change the way I get the information to connect to my database(the connection string). I want to set it up so that for all the information needed to connect to my database i use and XML with these details.

 

This is so that if I have different labels using different parts of the database and the name or IP of the database were to change all I would need to do to get everything working again is change the details in the XML document, and all the labels would be able to point back to the database correctly

4 评论

0
Avatar
Ian Cummings
版主
评论操作 固定链接

If you take a look at the BarTender XML script reference in the BarTender Help system you will see that you can specify a custom SQL query for an already existing database connection, but it is not possible to change the overall connection string to the database.

0
Avatar
Legacy Poster
评论操作 固定链接

Would the only way to work around that be using a script for each data field on the label, with the script making its own connection(reading the connection details from an xml then connecting )?This is the way I have done but it is not exactly efficient , making a scrip for each one is time consuming . Is their literally no other way to make this happen?

0
Avatar
Ian Cummings
版主
评论操作 固定链接

Correct, no other way currently.

 

In the future we do intend to redo the database connectivity in BarTender, to update and augment its capability, but it is what it is at the moment.

 

Perhaps an external application could be used for the database connectivity, and then control BarTender via automation, feeding it the data as needed for printing.

0
Avatar
Legacy Poster
评论操作 固定链接

I'm one who is looking for the added functionality of changing database connectivity on the fly.  I want to be able to change from production database to test database programmatically.  My workaround now is to have two copies of of each label and switch which label I'm using based on the environment I'm in.  It works but it is really cumbersome when it comes to changing the labels. Please add this feature soon if possible.  

请先登录再写评论。