Creating Db Connection At Runtime 追蹤
I use Access and Bartender in many of my Excel macros. I am able to build a connection string for the Access db based upon the workbook path. For example:
ConnStrg = "provider=microsoft.ACE.OLEDB.12.0;data source=" & ThisWorkbook.Path
ConnStrg = ConnStrg & "\ReorderDB.accdb;persist security info=false;"
I would like to do the same for Bartender, that is create the format database connection at runtime. Any suggestions?
1 意見
Although we strongly recommend using the built in database connection setup directly supported by BarTender you could always built the connection using a VB script. Note that in this case you would need to use script to load the information on each of your document's objects.
Also note that you could always create a join in BarTender between different databases instead of needed to custom make the required database connection.
*In any case, I'm attaching a simple example we built some time ago that uses a script in the Data Entry Form to query a database and load its data to the label objects. The script does the following:
1. Fills a drop down list from an Excel spreadsheet.
2. Uses the choice selected in the drop down list to query the database again to retrieve records that match the selection.
請登入寫評論。