ADO Import Genie

Description

The ADO Import Genie allows you to import data from remote databases, such as Microsoft Access, Microsoft SQL Server, MySQL, Oracle, or any other database for which an ADO provider or ODBC driver is available. The ADO Import Genie also imports data from the most current versions of Microsoft Excel.

Importing From Excel

  1. Place the names of the fields you want to create (in the import table) in the first row of the spread sheet. If you are going to append the imported data to an existing table, make sure that these column titles are the same as the target table's field names.

  2. Make sure that every cell in the first row of data (the second row of the spread sheet) has a value.

  3. Assign a numeric or date format to all cells that have numeric or date contents. If you are going to append the imported data to an existing table, make sure that data types the same as the target table's field data types.

  4. The genie imports numeric fields as type "ExponentNumeric". After import, you may open the Restructure Table utility and change these fields to numeric with 0 or more decimal positions.

Defining an Import Operation

  1. Run the ADO Import Genie.

  2. In the Data Source > Connection type field select one of the following:

    • "Access Database"

    • "Excel Spreadsheet"

    • "ADO Connection string" (for all other databases)

  3. If you selected to import from a Microsoft Access database, in the Data Source > Access database field click to navigate to and select the .MDB file that contains the data.

  4. If you selected to import from a Microsoft Excel spreadsheet, in the Data Source > Excel spreadsheet field click to navigate to and select the spreadsheet file that contains the data.

  5. If you selected to use an ADO Connection String to connect to the database, enter the necessary connecting string into the Data Source > Connection string field. Optionally, click '...' to display the Windows Data Link Properties dialog, which can assist you in creating a new connection string.

  6. If required, enter your user name into the Data Source > User name field.

  7. If required, enter your password into the Data Source > Password field.

  8. Select how to read the data in the Data Source > Populate from SQL or table field. The options are:

    • "Table"

    • "SQL"

  9. If you selected to import data from a "Table":

    • 1. Click the 'down' icon in the Data Source > Source table field to select the database table or spreadsheet to import.

    • 2. Click the '...' button in the Data Source > Fields field to display the Select Fields dialog box.

    • Use the '<<','<','>', and '>>' buttons to move the fields that you want to import from the Available Fields list to the Selected Fields list.

    • Use the following buttons to sequence the buttons in the order you want them to appear in the Alpha Anywhere table.

      images/Move_First_button.gif
      images/Move_Up_Button.gif
      images/Move_Down_Button.gif
      images/Move_Last_button.gif
    • Click OK to continue.

  10. If you selected to import your data with "SQL" statement:

    • 1. Click the '...' button in the Data Source > SQL statement field to display the Define SQL Statement dialog. Enter the appropriate SELECT statement to retrieve your data.

    • 2. Optionally, click the '...' button to display the Define Arguments dialog. Use this dialog to define arguments to use in the WHERE clause (filter) of the SQL statement.

    • 3. Click OK to continue.

  11. Enter the name of the table you want to create in the Data Source > Result table name field. If the table does not exist, it will be created. If the table does exist, it will be overwritten. Click the '...' button to select the directory location for the new table.

Run Time Options

  1. Optionally, in the Options > Run silently list select "True". When set to "True", the ADO Import Genie will not display errors or ask if you want to overwrite an existing table.

  2. Optionally, in the Options > Overwrite existing tables list select "True". When set to "True", the ADO Import Genie will overwrite existing tables without a prompt to the user. If the Options > Run silently field is set to "True" and Options > Overwrite existing tables is set to "False", the ADO Import Genie will not import the data if the result table already exists.

  3. Optionally, select "True" in the Options > Size to fit list. "True" causes the result table field sizes to be minimized to fit the data being import. "False" causes the result table field sizes to be based on the sizes of the fields in the source table.

  4. Optionally, select "True" in the Options > Import Time fields as Date fields list. By default Date/Time fields are imported as Time fields, which loses any date information. The Date field format preserves both date and time information.

Openingand_Running_Import_Operations>Saving, Opening, and Running Import Operations

  1. Optionally, click the 'save' icon to save the import operation for re-use in the future. The operation will appear on the Operations tab of the Control Panel.

  2. Optionally, click the following to begin the definition of a new import operation.

    images/New_Query_button.gif
  3. Optionally, click the 'open folder' icon to open a saved import operation.

    images/Folder_button.gif
  4. Click the 'lightning' icon to run the operation.

  5. Click the following to display the data you plan to import in the ADO Import Genie Preview dialog.

    images/Preview_Form_button.gif
  6. Optionally, click the 'XB' icon to display the Xbasic code behind this operation. You can copy this code an use it in a script.

See Also