Microsoft KB Archive/258428

= FIX: A printer name that is longer than 64 characters causes an error message in Visual FoxPro for Windows 6.0 =

Article ID: 258428

Article Last Modified on 8/7/2007

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q258428



SYMPTOMS
A printer has a name longer than 64 characters. When you try to print to this printer in Visual FoxPro using a command, such as LIST STRUCTURE TO PRINT, or a report form, you receive the error:

Fatal error: Exception: code:=C0000005



RESOLUTION
Either upgrade to the latest service pack for Visual Studio 6.0 or change the name of the printer so it is less than 64 characters in length.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That a Visual Studio Service Pack Is Installed

To download the latest Visual Studio service pack, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/vstudio/Aa718353.aspx



MORE INFORMATION
If the printer name is between 64 and 204 characters in length, the error may not immediately occur and may appear intermittently in an application. If the printer name is longer than 205 characters, the behavior normally occurs immediately.   Run the following line of code in the Command window: _cliptext=REPLICATE("a",205)  From the Start menu, select Settings, open Control Panel, and then choose the Printers option. Highlight a local printer and press the F2 key. Paste the contents of Clipboard into the printer name using the CTRL+V key combination. Press ENTER to save the name. Right-click the newly renamed printer and set it as the default. Exit and restart Visual FoxPro.  Place the following code into a program and run it: SET SAFETY OFF CREATE TABLE testtab (f1 c(5)) INSERT INTO testtab (f1) VALUE ("aaaa") LIST STRUCTURE TO PRINTER CREATE REPORT test FROM testtab REPORT FORM test TO PRINTER The error mentioned in the "Symptoms" section appears and Visual FoxPro closes. </ol>

Additional query words: sp4

Keywords: kbbug kbcodesnippet kbfix kbprint kbvs600sp4fix kbvs600sp5fix KB258428

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.