Importing Data into the VTS Table
VTS lets you import data in the VTS table. You can import data either from a database or from a CSV file.
You can import data multiple times into the same table. Each time you import data, the data is appended to the existing data in the table - the existing data is not deleted. If you want the imported data to be the only data in the table, click Delete Table on the VTS toolbar before importing the new data.
For details on exporting data from the VTS table, see Exporting Data from the VTS Table.
Importing from a database
When you import data from a VTS table to a database, you are required to enter an ADO connection string. The VTS server will connect to the database using this connection string. A typical connection will include the following properties:
- Data Source
- Initial Catalog
Refer to http://msdn.microsoft.com/en-us/library/ee252362(v=bts.10).aspx for details about the connection string format.
To import from a database, you run the command line utility vts_import from the VTS\bin folder using this syntax:
C:\Program Files\Micro Focus\VTS\bin>vts_import –connection “connection_string” -query “sql_query_string” [-inst “vts_instance_name”]
The command line options are:
The string that VTS will use to connect to the database.
The SQL statement to use to query the database.
The VTS instance name for which the operation is applied. When not set, it uses the “Default” instance.
The provider specified in the connection string should have already been installed on the web server.
Note: If the connection string specifies the use of windows authentication (for example, Integrated Security=SSPI), the credentials of the Windows service that runs the website will be used to access the server.
This may cause a problem when running VTS Service under local machine accounts. If you encounter problems, try to run the VTS Service under a domain account that has access to the remote database.
Importing from a CSV file
When you import data from a CSV file, you must specify the name and location of the CSV file, and the delimiter that is used in the file.
To import data from a CSV file:
- Click Import on the VTS toolbar.
- In the Import dialog box, click Import from CSV file.
- Click Select File, and specify the file that contains the data to import.
- From the Delimiter list, select the delimiter that is used in the CSV file. Keep the <Auto Detect> option to let VTS determine the delimiter that is used in the CSV file.
- Click Start Import to begin importing the data into the VTS table.
Using the sample files
Sample tables are provided (Customers, Employees, Products, Orders) which can be imported into any VTS instance. Additionally, you can add your own .csv files to the Samples folder.
How to import a sample table
- Click Options > Import Samples
- Select one of the sample tables
How to add and import files from the samples directory
- Copy your .csv file into the Samples folder. By default, the folder location is C:\Program Files\Micro Focus\VTS\web\Samples.
- Click Options > Import Samples. Select your .csv file from the drop-down list to populate the data table.