Click to See Complete Forum and Search --> : unspecified error when using disconnected


almike
October 17th, 2001, 09:42 AM
I have a disconnected recordset that I use as a data store so that I can use the filter and sort properties. It worked great in VB6 MDAC2.5 on Win98.

We are now porting to Win2K, VB6, MDAC2.6 and I get an unspecified error on the recordset when I try to do an addnew, some other method or even just setting one of the fields. It works great for a while but as the recordset grows, eventually I get 'Unspecified Error' failure. The error does not consistantly happen at the same place everytime, and appears to occur as the recordset grows. This makes me suspect some kind of memory leak or something. Any Ideas? The following is how I create the recordset.

Private Sub createRS as recordset()
Dim rs As New Recordset

'create the recordset
With rs
.Fields.Append "A", adChar, 4
.Fields.Append "B", adChar, 1200
.Fields.Append "C", adChar, 2000
.Fields.Append "C", adChar, 12
.Fields.Append "E", adChar, 50
.Fields.Append "F", adChar, 4
.Fields.Append "G", adChar, 8
.Fields.Append "H", adChar, 8, adFldIsNullable
.Fields.Append "I", adChar, 8
.Fields.Append "J", adInteger
.Fields.Append "K", adInteger
.Fields.Append "L", adChar, 10
.Fields.Append "M", adChar, 40
.Fields.Append "N", adChar, 24
.Fields.Append "O", adChar, 4
.Fields.Append "P", adChar, 4
.Fields.Append "Q", adChar, 4
.Fields.Append "R", adInteger
.Fields.Append "S", adInteger
.Fields.Append "T", adBoolean
.Fields.Append "U", adBoolean
.Fields.Append "V", adBoolean
.Fields.Append "W", adChar, 10, adFldIsNullable
.Fields.Append "X", adChar, 10, adFldIsNullable
.Fields.Append "Y", adInteger
.Fields.Append "X", adBoolean
.Fields.Append "Z", adBoolean
.CursorLocation = adUseClient
.Open
End With
Set createRS = rs

Thanks for any insight.

PSH

dcaillouet
October 17th, 2001, 10:18 PM
Would it be possible to use adVarChar instead of adChar for your fields (especially the big ones)? CHAR fields are padded with spaces so they are always the maximum size. VARCHARs would take up less space.

almike
October 24th, 2001, 07:54 PM
Thanks for the recommendation. I implemented, but the problem still exists. The only way I have been able to work around is by reducing the length specification of the fields that are really big (1200/2000). I know that for production, I will need the length, so this is no good. I got one other hint - I was running in the debugger and got the "unspecified error" message. I hit debug and it showed me the record in error (.addNew on the recordset). After a minute or so, I selected debug continue again so that I could show the behavior to a coworker. On the same record, the debugger now showed "row handle could not be resolved" - bizzar. Have not been able to repeat this process. I do sorts and filters on the recordset and I think it may be MS buggy. Then tried to clear sorts and filters, save bookmark, do .addnew, then reset sort, filter, and bookmark. Still same error. The saddest part is that I cannot consistantly repeat this under exact same conditions and have not been able to build a small test case that has the same behavior. ?????

PSH