How does this happen?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How does this happen?

Hybrid View

  1. #1
    S Guest

    How does this happen?

    Here's the code:
    ' This function is in a COM .dll, there are no statements between
    ' the client calling Addrecord, and the execution of this function in
    the COM.
    Public Function AddRecord(colCollection As Collection) As Collection
    Dim blnHolder As Boolean
    ' Right now, rsRecordset contains the contents of colCollection as
    the
    ' first record!!!!!!! E.G. ? rsRecordSet.fields(1) returns the
    value contained
    ' in colCollection. Doing a watch on rsRecordSet shows the
    "value" as coming
    ' from colCollection, and the "underlying value" as the original
    value in the rs
    ' Update the class copy of the recordset
    rsRecordSet.AddNew
    blnHolder = FillRecordSet(colCollection)
    ' Update Database
    If blnHolder Then
    rsRecordSet.Update
    Set AddRecord = colCollection
    ....

    I don't see how the contents of the collection colCollection could
    possibly get into rsRecordset, and
    the private mrsRecordset by just calling this function. rsRecordset
    does not exit in the client. Nothing
    bound to anything.

    I've worked on this for three days, and can't figure out how this
    could possibly happen.

    Any insight, or even guesses would be helpful

    Thanks
    Scott


  2. #2
    Joe Maki Guest

    Re: How does this happen?


    Looks to me like FillRecordSet(colCollection) is taking the collection and
    adding it to the recordset. Note unless it completes correctly (blnHolder)
    it doesn't update the recordset. You might want to look at FillRecordSet()

    ...joe

    "S" <bangorme@NoSpamhotmail.com> wrote:
    >Here's the code:
    >' This function is in a COM .dll, there are no statements between
    >' the client calling Addrecord, and the execution of this function in
    >the COM.
    >Public Function AddRecord(colCollection As Collection) As Collection
    > Dim blnHolder As Boolean
    > ' Right now, rsRecordset contains the contents of colCollection as
    >the
    > ' first record!!!!!!! E.G. ? rsRecordSet.fields(1) returns the
    >value contained
    > ' in colCollection. Doing a watch on rsRecordSet shows the
    >"value" as coming
    > ' from colCollection, and the "underlying value" as the original
    >value in the rs
    > ' Update the class copy of the recordset
    > rsRecordSet.AddNew
    > blnHolder = FillRecordSet(colCollection)
    > ' Update Database
    > If blnHolder Then
    > rsRecordSet.Update
    > Set AddRecord = colCollection
    >....
    >
    >I don't see how the contents of the collection colCollection could
    >possibly get into rsRecordset, and
    >the private mrsRecordset by just calling this function. rsRecordset
    >does not exit in the client. Nothing
    >bound to anything.
    >
    >I've worked on this for three days, and can't figure out how this
    >could possibly happen.
    >
    >Any insight, or even guesses would be helpful
    >
    >Thanks
    >Scott
    >



  3. #3
    S Guest

    Re: How does this happen?

    Unfortunately the error occurs long before FillRecordSet(). When I
    step into the function, it's already in the recordset. It's not
    supposed to be in the recordset until after FillRecordSet().


    "Joe Maki" <jmaki@customerlinkone.com> wrote in message
    news:3cd4178e$1@10.1.10.29...
    >
    > Looks to me like FillRecordSet(colCollection) is taking the

    collection and
    > adding it to the recordset. Note unless it completes correctly

    (blnHolder)
    > it doesn't update the recordset. You might want to look at

    FillRecordSet()
    >
    > ..joe
    >
    > "S" <bangorme@NoSpamhotmail.com> wrote:
    > >Here's the code:
    > >' This function is in a COM .dll, there are no statements between
    > >' the client calling Addrecord, and the execution of this function

    in
    > >the COM.
    > >Public Function AddRecord(colCollection As Collection) As

    Collection
    > > Dim blnHolder As Boolean
    > > ' Right now, rsRecordset contains the contents of colCollection

    as
    > >the
    > > ' first record!!!!!!! E.G. ? rsRecordSet.fields(1) returns

    the
    > >value contained
    > > ' in colCollection. Doing a watch on rsRecordSet shows the
    > >"value" as coming
    > > ' from colCollection, and the "underlying value" as the original
    > >value in the rs
    > > ' Update the class copy of the recordset
    > > rsRecordSet.AddNew
    > > blnHolder = FillRecordSet(colCollection)
    > > ' Update Database
    > > If blnHolder Then
    > > rsRecordSet.Update
    > > Set AddRecord = colCollection
    > >....
    > >
    > >I don't see how the contents of the collection colCollection could
    > >possibly get into rsRecordset, and
    > >the private mrsRecordset by just calling this function.

    rsRecordset
    > >does not exit in the client. Nothing
    > >bound to anything.
    > >
    > >I've worked on this for three days, and can't figure out how this
    > >could possibly happen.
    > >
    > >Any insight, or even guesses would be helpful
    > >
    > >Thanks
    > >Scott
    > >

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center