Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

BUG: MSDAIPP Provider Does Not Deny The Assignment of an Integer Value to an Array Typed Column


View products that this article applies to.

This article was previously published under Q245498

↑ Back to the top


Symptoms

When you assign an integer value to an Array typed field, the Microsoft Internet Publishing Provider (MSDAIPP) does not deny the assignment and the following error message occurs when you try to retrieve the field's value:
Run-time error # 13: � Type mismatch

↑ Back to the top


Resolution

Make sure that your data types are compatible before you assign any value to a given field.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


More information

The following Microsoft Visual Basic sample code demonstrates:

  • The creation of an array field, rec("x").

  • The assignment of an integer value (zero) to rec("x"). In this case, ActiveX Data Objects (ADO) takes the (zero) value and assigns it as the current value of the rec("x") field without returning an error message.

  • The retrieval of the rec("x") field's value, where you get a "Type mismatch" error message.

Steps to Reproduce Behavior

  1. Create an empty text file named Text.txt on <Name_of_Your_Web_Server>.
  2. Start a new Visual Basic Standard EXE project. Form1 is added by default.
  3. From the Project menu, click References, and then select the "Microsoft ActiveX Data Objects 2.5 Library".
  4. Place the following code in the General Declaration section of Form1:
    Private Sub Command1_Click()
    
    Dim rec As New Record
    
    rec.Open "http://<Name_of_Your_Web_Server>/test.txt", , adModeReadWrite, adCreateOverwrite
       
    rec.Fields.Append "x", adArray + adVariant
    rec("x") = Array(1, 2)
    
    Debug.Print rec("x")(0), rec("x")(1)    ' This returns: 1, 2
    
    rec("x") = 0                        ' <--- WRONG: Assigning an integer to an array column 
    
    Debug.Print rec("x").Type           ' This returns 8204 (stands for adArray + adVariant data-type)
    Debug.Print rec("x")(0)             ' Error 13 occurs here
    
    rec.Close
    
    End Sub
    					
  5. Run the code to see the error message occur.

↑ Back to the top


References

Platform SDK Online Help

↑ Back to the top


Keywords: KB245498, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 245498
Revision : 3
Created on : 5/8/2003
Published on : 5/8/2003
Exists online : False
Views : 321