Microsoft KB Archive/174972: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 12: Line 12:
<div id="TitleRow">
<div id="TitleRow">


= <span id="KB174972"></span>&quot;Unable to Write to Database&quot; Error with Null String =
= <span id="KB174972"></span>"Unable to Write to Database" Error with Null String =




Line 72: Line 72:
<br />
<br />


* The formula returns a null string (&quot;&quot;).
* The formula returns a null string ("").




Line 80: Line 80:
== WORKAROUND ==
== WORKAROUND ==


To work around this problem, modify the worksheet formula so that it does not return a null string (&quot;&quot;).<br />
To work around this problem, modify the worksheet formula so that it does not return a null string ("").<br />
<br />
<br />
For example, if the worksheet contains the following formula
For example, if the worksheet contains the following formula
<pre class="codesample">  A1: 1  B1: =IF(A1=1,&quot;&quot;,&quot;not 1&quot;)
<pre class="codesample">  A1: 1  B1: =IF(A1=1,"","not 1")
                 </pre>
                 </pre>
and cell B1 is linked to a field in your database, you receive the error message when you try to save data. To prevent the message from appearing, change the formula in cell B1 to the following:
and cell B1 is linked to a field in your database, you receive the error message when you try to save data. To prevent the message from appearing, change the formula in cell B1 to the following:
<pre class="codesample">  =IF(A1=1,&quot; &quot;,&quot;not 1&quot;)
<pre class="codesample">  =IF(A1=1," ","not 1")
                 </pre>
                 </pre>
NOTE: The only difference between the two formulas is that the second one contains a space between the quotation marks.
NOTE: The only difference between the two formulas is that the second one contains a space between the quotation marks.
Line 116: Line 116:


</div>
</div>
and then double-click the selected text to go to the &quot;What is the Template Wizard with Data Tracking?&quot; topic.
and then double-click the selected text to go to the "What is the Template Wizard with Data Tracking?" topic.


</div>
</div>

Latest revision as of 11:08, 21 July 2020

Article ID: 174972

Article Last Modified on 8/17/2005



APPLIES TO

  • Microsoft Excel 97 Standard Edition
  • Microsoft Excel 95 Standard Edition



This article was previously published under Q174972


SYMPTOMS

If you are saving a template that was created by using the Template Wizard in Microsoft Excel, you may receive the following error message

Unable to write data to database. Make sure database is not protected and has valid field data-types.

and you cannot save data to the database.

CAUSE

This problem occurs when all of the following conditions are true:

  • You are saving your data to a Microsoft Access database. -and-


  • One of the fields in your Access database is linked to a worksheet cell that contains a formula. -and-


  • The formula returns a null string ("").


WORKAROUND

To work around this problem, modify the worksheet formula so that it does not return a null string ("").

For example, if the worksheet contains the following formula

   A1: 1   B1: =IF(A1=1,"","not 1")
                

and cell B1 is linked to a field in your database, you receive the error message when you try to save data. To prevent the message from appearing, change the formula in cell B1 to the following:

   =IF(A1=1," ","not 1")
                

NOTE: The only difference between the two formulas is that the second one contains a space between the quotation marks.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

The Template Wizard with Data Tracking add-in creates a template that links selected cells in a workbook to fields in a database. When you base a new workbook on the template and enter data in the linked cells, Microsoft Excel creates a new record in the database and copies the data to the corresponding data fields.

REFERENCES

For more information about the Template Wizard, click the Index tab in Microsoft Excel Help, type the following text

template


and then double-click the selected text to go to the "What is the Template Wizard with Data Tracking?" topic.


Additional query words: XL97 XL

Keywords: kberrmsg kbbug KB174972