PRB: Error 80040e14 When You Create a Recordset with adVarWChar (280138)



The information in this article applies to:

  • ActiveX Data Objects (ADO) 2.5
  • ActiveX Data Objects (ADO) 2.6
  • ActiveX Data Objects (ADO) 2.7

This article was previously published under Q280138

SYMPTOMS

When you try to use the Shape Provider's Append New clause to build a Recordset from scratch, you may receive the following error message:
Run-time error '-2147217900 (80040e14)':
Width specified for NEW column <column_name> is too large.

CAUSE

The Shape Provider does not support NEW string columns whose maximum lengths are greater than 255 characters. If the NEW string columns are greater than 255 characters, they must have an unlimited maximum length.

RESOLUTION

To resolve this problem, use a Type such as adLongVarChar or adLongVarBinary that does not require a Length argument (that is, they have unlimited length).

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual Basic, start a new Standard EXE project. Form1 is created by default.
  2. Add a reference to Microsoft ActiveX Data Objects Library.
  3. In the Load method of Form1, paste the following code:
    Dim rs As ADODB.Recordset
    Set rs = CreateObject("ADODB.Recordset")
    rs.Open "SHAPE APPEND NEW adChar(10) NewCol1," & _
            "NEW adVarWChar(500) NewCol2", _
            "Provider=MSDATASHAPE;Data Provider=None;", _
            adOpenStatic, adLockBatchOptimistic
    					

Modification Type:MajorLast Reviewed:8/23/2001
Keywords:kbCodeSnippet kbDSupport kbprb KB280138