IMPORT ACCESS command

Creates an Analytics table by defining and importing a Microsoft Access database file.

Syntax

IMPORT ACCESS TO table <PASSWORD num> import_filename FROM source_filename TABLE input_tablename CHARMAX max_field_length MEMOMAX max_field_length

Parameters

Name Description
TO table

The name of the Analytics table to import the data into.

Note

Table names are limited to 64 alphanumeric characters. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number.

PASSWORD num

optional

Used only with password-protected Access files.

The password definition to use.

You do not use PASSWORD num to prompt for, or specify, an actual password. The password definition refers to a password previously supplied or set using the PASSWORD command, the SET PASSWORD command, or the PASSWORD analytic tag.

num is the number of the password definition. For example, if two passwords have been previously supplied or set in a script, or when scheduling an analytic, PASSWORD 2 specifies that password #2 is used.

For more information about supplying or setting passwords, see:

import_filename

The name of the Analytics data file to create.

Specify import_filename as a quoted string with a .FIL file extension. For example, "Invoices.FIL".

By default, the data file (.FIL) is saved to the folder containing the Analytics project.

Use either an absolute or relative file path to save the data file to a different, existing folder:

  • "C:\data\Invoices.FIL"
  • "data\Invoices.FIL"

FROM source_filename

The name of the source data file. source_filename must be a quoted string.

If the source data file is not located in the same directory as the Analytics project, you must use an absolute path or a relative path to specify the file location:

  • "C:\data\source_filename"
  • "data\source_filename"
TABLE input_tablename

The name of the table in the Microsoft Access database file to import.

CHARMAX max_field_length

The maximum length in characters for any field in the Analytics table that originates as character data in the source from which you are importing.

You can specify from 1 to 255 characters.

MEMOMAX max_field_length

The maximum length in characters for text, note, or memo fields you are importing.

You can specify from 1 to 32767 characters (non-Unicode Analytics), or 16383 characters (Unicode Analytics).

Examples

For more information about how this command works, see Import a Microsoft Access database file.

Importing into a table

You have a Microsoft Access file called Acceptable_Codes.mdb. You need to import the [Acceptable_Codes] table from the file into Analytics. To do this, you use the following command and create a table called acc_codes in Analytics.

The length of imported character or memo fields is set to the length of the longest value in the field, or to the specified maximum number of characters, whichever is shorter:

SET ECHO NONE
SET PASSWORD 1 TO "qr347wx"
SET ECHO ON
IMPORT ACCESS TO acc_codes PASSWORD 1 "C:\ACL DATA\Sample Data Files\acc_codes.fil" FROM "Acceptable_Codes.mdb" TABLE "[Acceptable_Codes]" CHARMAX 60 MEMOMAX 70