Field.Type is changing

Field.Type is changing

Post by Jg Meie » Fri, 05 Mar 2004 21:29:06


Hi ng,

if I open an Recordset the Type of my field is changeing. Sample:

Dim RS as ADODB.Recordset
Set RS = new ADODB.Recordset
RS.Fields.Append "Feld1", adBSTR
RS.Fields.Refresh

Debug.Print RS.Fields("Feld1").Type
'prints 8 (adBSTR) --> all ok

RS.Open

Debug.Print RS.Fields("Feld1").Type
'prints 203 (adLongVarWChar) --> ???


The RS works. So far - so good. But if I try:

...

Dim NewRecordset as ADODB.Recordset
Set NewRecordset = new ADODB.Recordset

Dim Field As ADODB.Field
For Each Field In RSClone.Fields
NewRecordset.Fields.Append Field.Name, Field.Type '<-- error!
Next Field
...

I get an error 3001. The reason is the changed Type-Property to
adLongVarWChar. How can I solve this problem?

PS: ADO 2.1, VB6 SP5

Jg