How change a ADODB.RecordSet field writeable?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
How change a ADODB.RecordSet field writeable?
VBCode

Private Sub Command1_Click()
Dim rs As New ADODB.Recordset

rs.Open "C:0000000010data.xml", , adOpenStatic, adLockOptimistic
rs.Fields("PictureID").Value = "adfa"
End Sub


Data Source is a xml file



Error xmlFile:



<xml xmlns:s=uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882
<span style="white-space:pre xmlns:dt=uuid:C2F41010-65B3-11d1-A29F-00AA00C14882
<span style="white-space:pre xmlns:rs=urn:schemas-microsoft-com:rowset
<span style="white-space:pre xmlns:z=#RowsetSchema>
<s:Schema id=RowsetSchema>
<span style="white-space:pre <s:ElementType name=row content=eltOnly>
<span style="white-space:pre <s:AttributeType name=PictureID rs:number=1 rs:nullable=true>
<span style="white-space:pre <s:datatype dt:type=string rs:dbtype=str dt:maxLength=54/>
<span style="white-space:pre </s:AttributeType>
<span style="white-space:pre </s:ElementType>
</s:Schema>
<rs:data>
<span style="white-space:pre <z:row PictureID=Test.tif/>
</rs:data>
</xml>


Correct xml



<xml xmlns:s=uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882
<span style="white-space:pre xmlns:dt=uuid:C2F41010-65B3-11d1-A29F-00AA00C14882
<span style="white-space:pre xmlns:rs=urn:schemas-microsoft-com:rowset
<span style="white-space:pre xmlns:z=#RowsetSchema>
<s:Schema id=RowsetSchema>
<span style="white-space:pre <s:ElementType name=row content=eltOnly>
<span style="white-space:pre <s:AttributeType name=PictureID rs:number=1 rs:nullable=true rs:writeunknown="true" >
<span style="white-space:pre <s:datatype dt:type=string rs:dbtype=str dt:maxLength=54/>
<span style="white-space:pre </s:AttributeType>
<span style="white-space:pre </s:ElementType>
</s:Schema>
<rs:data>
<span style="white-space:pre <z:row PictureID=Test.tif/>
</rs:data>
</xml>



rs:writeunknown="true" Attribute miss




View the full article
 
Back
Top