Category Archives: Code

VBA: How to List Table Definitions in Access File


In this article, we will introduce code that converts a list of table definitions within Microsoft Office Access(アクセス) (.mdb) files into Oracle-compatible table definitions and outputs them as a list.

Overview

  • We will use Excel and VBA for this process.
  • By running the VBA function GetTableDefinitions, you can output a list of table definitions from an Access file to the open Excel sheet.
  • We will create text data intended to be pasted into a table definition document (.xls).
  • For Access tables converted to Oracle, text columns, for example, will be displayed as VARCHAR2.
  • We won’t output system tables (you can modify the code to include them if needed).
  • Link tables will display the contents of the links. The definitions of linked destination tables will not be output.

How to Use

  1. Open Excel.
  2. Open the Visual Basic Editor from the development tools.
  3. Add a module.
  4. Check Microsoft DAO in the Tools > References settings.
  5. Paste the code below.
  6. Execute the GetTableDefinitions function.
Continue reading VBA: How to List Table Definitions in Access File

How to Manipulate Field Objects in Crystal Reports


To manipulate objects in Report Designer, you may wonder how to get it done. Once you understand it, it’s a straightforward process, but getting to that point can be challenging. I tried doing it with VB.NET:

It involves some intricate work like casting (type conversion) to make properties accessible.

It seems that DirectCast is less resource-intensive than CType. You can find information about C# in the following page:

Reference: Crystal Reports

While it appears that you can’t vertically align text in the middle in Crystal Reports, this method might allow fine adjustments through the Location setting of the field.