Results 1 to 3 of 3

Thread: help

  1. #1
    yls Guest

    Default help

    error &#039 80020009&#039 <BR>Exception occurred. <BR>

  2. #2 Guest

    Default RE: help

    Check out<BR><BR>Here is what is returned for 800200009...<BR><BR><BR><BR>SYMPTOMS<BR>========<B R> <BR>The following error occurs when accessing a recordset in an Active Server Pages<BR>(ASP) file that contains "Text" or "Blob" type data from a SQL table:<BR> <BR> Microsoft OLE DB Provider for ODBC Drivers error &#039 80020009&#039<BR> <BR>CAUSE<BR>=====<BR> <BR>The following condition may cause the error to occur:<BR> <BR> Text/Blob fields are selected in an order preceding other types of fields.<BR> <BR>RESOLUTION<BR>==========<BR> <BR>When dealing with BLOB fields from SQL Server, you need to put them to the right<BR>of non-BLOB columns in the resultset. To be safe, you should also read the<BR>columns in left-to-right order, so if you have two BLOB columns as the last two<BR>columns in your resultset, read the first one and then the second. Do not read<BR>them in the reverse order.<BR> <BR>To demonstrate the correct order of field selection create a new ASP page in a<BR>Visual InterDev Project and paste the following code in the blank ASP page:<BR> <BR> &#060;%@ Language=VBScript %&#062;<BR> &#060;HTML&#062;<BR> &#060;BODY bgcolor=white&#062;<BR> &#060;%<BR> Set cn = Server.CreateObject("ADODB.Connection")<BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR> <BR> &#039Open the connection.<BR> cn.Open "&#060;Your DSN for Pubs database&#062;"<BR> <BR> &#039Open the recordset.<BR> <BR> &#039Notice that the Blob field, pr_info, is last in the field order.<BR> <BR> rs.Open "select pub_id, pr_info from pub_info", cn<BR> <BR> While Not rs.EOF<BR> <BR> Response.Write "&#060;P&#062;PR Info:&#060;P&#062;" & rs("pr_info")<BR> Response.Write "&#060;P&#062;That was the PR Info for PubID " & <BR> rs("pub_id")<BR> rs.MoveNext<BR> Wend<BR> %&#062;<BR> &#060;/BODY&#062;<BR> &#060;/HTML&#062;<BR> <BR>STATUS<BR>======<BR> <BR>This behavior is by design.<BR> <BR>MORE INFORMATION<BR>================<BR> <BR>SQL Server is sending back the data on the wire and the client is essentially<BR>receiving a stream of bits read sequentially on the network wire. With bound<BR>columns (that is, the values can be copied into local memory buffers and cached<BR>there), the driver transfers data in those columns to memory buffers. Once the<BR>data is in local buffers, you may read the data in any order. Therefore, you can<BR>read result columns in any order when all the columns are bound (not BLOBs).<BR> <BR>When you include BLOB columns, the length of the column can be approximately 2<BR>gigabytes and data access libraries typically do not bind those columns since<BR>the driver often cannot determine exactly how large the BLOB is until retrieved.<BR>Also, data access libraries typically avoid caching BLOB data since this may<BR>consume large amounts of memory and caching it both in the data access library<BR>and your application is inefficient. If the data access driver is requested to<BR>return the contents of a BLOB column, it typically discards non-bound columns<BR>that precede the requested BLOB column, since it must retrieve the sequential<BR>data stream before it can read the requested column. Therefore, it is more<BR>efficient to read your resultset from left-to-right since that matches the way<BR>the data is retrieved.<BR> <BR>Note that this describes the behavior of SQL Server, Oracle and other<BR>client/server DBMSs may do the same thing, but it is not required.<BR> <BR>Perhaps a better alternative is to avoid using a Text column. Since SQL Server<BR>allocates space in 2K chunks, using Text columns may result in inefficient use<BR>of storage if the text length is very small. Backup time is also affected since<BR>it takes longer to dump the transaction log. It is often better to create<BR>another table that has the PK of your existing table, a chunk number column, and<BR>a varchar (255) column. Divide the text into as many 255 character chunks needed<BR>and insert as many rows in the new table as there are chunks. It is usually<BR>worth the additional coding time since you make more efficient use of storage<BR>and backups go much faster.<BR> <BR>Additional query words: kbdsi<BR> <BR>============================================== ========================<BR>Keywords : kberrmsg kbADO kbVisID kbOBDC <BR>Version : WINDOWS:1.0; winnt:<BR>Platform : WINDOWS winnt<BR>Issue type : kbprb<BR>========================================= ====================================<BR>Copyright Microsoft Corporation 1999.<BR>

  3. #3
    Join Date
    Dec 1969

    Default More info...

    More info please

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts