Microsoft KB Archive/131584

= ACC2:"Invalid Argument" Error Msg Exporting Table to SQL Server =

Article ID: 131584

Article Last Modified on 11/6/2000

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q131584





SYMPTOMS
Advanced: Requires expert coding, interoperability, and multiuser skills.

When you export a table that contains zero-length strings to Microsoft SQL Server, you receive the error message "Invalid Argument," and the Export command is not successful.



RESOLUTION
To work around this problem, do one of the following:


 * Use Microsoft Access Upsizing Tools version 1.0 to transfer the table to Microsoft SQL Server.
 * Before exporting the table, update the fields that contain zero-length strings so that they contain null values.

To update the fields so that they contain Null values, follow these steps.

CAUTION: Following the steps in this example will modify your table. You may want to back up your table, or perform these steps on a copy of your table.

 Open the database containing the table you want to export. Create a select query based on the table you want to export. Add all the table's fields to the QBE grid and set Show to True for all the fields.  Add the following new field to the QBE grid, replacing  with the field name in your table that contains zero-length strings:

     Field: Expr1:Len([]) Criteria: 0

Note that when you run the query, a zero (0) is displayed in the new field for each record in  that contains a zero-length string.  Change the select query to an update query, and then type null in the Update To row of <Field2>.</li> Run the update query. Note that all the zero-length strings in <Field2> are changed to Null values. You can now export the table to Microsoft SQL Server.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed this to be a problem in Microsoft Access version 2.0. This problem no longer occurs in Microsoft Access version 7.0.

<div class="references_section">