Loading Data

The following steps provide an overview of how to load data. These steps assume that an application has previously been opened with one of the OpenApplication methods.

Tip:

For an example that illustrates these steps, see Example for Loading Data.

  To load data:

  1. Set an object reference to the HsvcDataLoad object.

  2. Point to the application into which data is being loaded by calling HsvcDataLoad.SetSession. For SetSession’s argument, pass the HsvSession object reference that was returned by HsxClient.OpenApplication or HsxClientUI.OpenApplication.

  3. Set an object reference to the IHsvLoadExtractOptions interface with the HsvcDataLoad.LoadOptions property.

  4. To load data, you must override the Mode load option’s default setting; by default, data load files are scanned for syntax errors without being loaded. To override this default setting, perform the following steps:

    1. Pass the HSV_DATALOAD_OPT_MODE constant to Item to return an IHsvLoadExtractOption object reference for the Mode load option.

    2. Set the IHsvLoadExtractOption interface instance’s CurrentValue property to HSV_DATALOAD_LOAD.

  5. Optional. To override the defaults for other load options, specify the values for these options. The available load options are listed in Table 79, Data Load Options.

  6. Load the data by calling HsvcDataLoad.Load or HsvcDataLoad.Load2. Both methods take the file names and paths of the data load file and of the log file; Load2 also returns a flag that indicates whether loading errors were logged.