Microsoft KB Archive/191099

= ACC97: Out of Memory Error Viewing ASP Page with a Large SQL Statement =

Article ID: 191099

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition
 * Microsoft Internet Information Server 3.0
 * Microsoft Visual Basic, Scripting Edition 2.0
 * Microsoft Active Server Pages 4.0

-



This article was previously published under Q191099



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



SYMPTOMS
When you browse to an Active Server Pages (ASP) file that was exported from Microsoft Access 97, and the file contains a large query, you may receive the following error message:

Microsoft VBScript compilation error '800a03e9' Out of Memory



CAUSE
The ASP page contains a query that exceeds the 1,022 character line limit set by VBScript and you are using the Microsoft products listed at the beginning of this article.



RESOLUTION
To correct this problem, you must first open the .ASP file using Notepad or another text editor, and break the SQL string into smaller segments. For example, assume that you have the following select statement within your ASP file:

  sql = "Select * from MyTableName where FieldName = 'aaaa'"

This statement should be modified as follows:

  sql = "Select *" sql = sql & " from MyTableName" sql = sql & " where FieldName = 'aaaa'"



How to Determine Your Version of VBScript and ASP
To determine which version of VBScript you have, follow these steps:

 Click the Start button, point to Find, and then click Files Or Folders. In the Named box, type vbscript.dll, and then click Find Now. Using the right mouse button, click the Vbscript.dll file name in the Name list, and on the shortcut menu, click Properties.  Click the Version tab and note the "File version" information.

<pre class="fixed_text">     VBScript   DLL version   File Date   File Size ---     2.0        2.0.0.1125    (varies)    252,232 bytes </li></ol>

For additional information about versions of VBScript, please see the following article in the Microsoft Knowledge Base:

167138 OL97: General Information About Using VBScript with Outlook

To determine which version of ASP you have, follow these steps:

<ol> Click the Start button, point to Find, and then click Files Or Folders.</li> In the Named box, type asp.dll, and then click Find Now.</li> Using the right mouse button, click the asp.dll file name in the Name list, and on the shortcut menu, click Properties.</li>  Click the Version tab and note the "File version" information.

<pre class="fixed_text">     ASP        DLL version   File Date   File Size ---     1.0b       1.15.14        3/14/97    378,992 </li></ol>

Steps to Reproduce Behavior
NOTE: This section contains information about editing ASP files, and assumes that you are familiar with editing ASP files. Microsoft Access Product Support professionals do not support customization of any HTML, HTX, IDC, or ASP files.

CAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.

<ol> Start Microsoft Access and open the sample database Northwind.mdb</li> Select the Invoices query from the Database window, and then on the Edit menu, click Copy.</li> On the Edit menu, click Paste. In the Paste As dialog box, type qryASPTest.</li>  Open the qryASPTest query in Design view, and add the following fields to the query grid:

<pre class="fixed_text">       Field: QuantityPerUnit Table: Products Show: Yes

Field: UnitsInStock Table: Products Show: Yes

Field: UnitsOnOrder Table: Products Show: Yes </li>  Add the following criteria to the CustomerID field:

<pre class="fixed_text">       [Enter ID] </li> On the Query menu, click Parameters.</li>  Type the following in the Query Parameters dialog box, and then click OK.

<pre class="fixed_text">       Parameter          Data Type [Enter ID]        Text </li> Save the qryASPTest query and close it.</li> Select the qryASPTest query in the Database window, and then on the File menu click Save As/Export.</li> In the Save As dialog box, click "To an External File or Database," and then click OK.</li> In the "Save Query 'qryASPTest' In" dialog box, select Microsoft Active Server Pages (*.asp) in the Save As Type box, and type qryASPTest.asp in the File Name box. Note the folder where the files will be exported. Click Export. The Microsoft Active Server Pages Output Options dialog box appears.</li> In the Data Source Name box, enter the name of a System DSN that points to the sample database Northwind.mdb.

For more information on how to define a system DSN, search the Help index for "ODBC, setting up data sources," and see the following article in the Microsoft Knowledge Base:

159682 "Data Source Name Not Found" Err Msg Opening Web Page</li> <li>Click OK in the Enter Parameter Value dialog box that appears. Note that the ASP output creates two files: qryASPTest.html and qryASPTest.asp.</li> <li>Copy qryASPTest.html and qryASPTest.asp to a folder on your Web Server computer where you have both Read and Execute permission. Read permission is necessary to browse the HTML file, and execute permission is necessary to run the ASP file.</li> <li>Start Microsoft Internet Explorer or another Web browser program. Type the Uniform Resource Locator (URL) in the address box of your Web browser to view qryASPTest.html. For example, if you saved your IDC files in a folder called Test in the wwwroot folder of your Web Server, type:

http://%3Cservername%3E/test/qryASPTest.html

Note that the URL depends upon where your files are located on the Web Server.</li> <li>Type QUEEN, and then click Run Query.</li></ol>

Note that you receive the error message described in the "Symptoms" section of this article.

For more information about configuring Microsoft Internet Information Server (IIS) permissions, please refer to the IIS Help Index, and see the following article in the Microsoft Knowledge Base:

160754 Error "HTTP/1.0 403 Access Forbidden" Browsing IDC Page

<div class="references_section">