Results 1 to 4 of 4

Thread: Binding to TexBox With ADO ~ Crashes Vb6 {RESOLVED}

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Posts
    12

    Unhappy Binding to TexBox With ADO ~ Crashes Vb6 {RESOLVED}

    Background:
    Have used DAO for years... finally moving apps to ADO.
    Pretty familar with ADO.
    Sequence of events in DAO.
    * Build Datacontrol for DAO via VB6.
    * Connect to Database, get recorset; set bind textboxes
    ~ no problem.
    Sequnence of event in ADO.
    *Build Datacontrol for ADO via VB6.
    *command type = UNKNOWN
    *connection string = we assign at start up.
    *CursorType=adOpenDynamic
    *CursorLocation=adUseClient

    1. build connection string.
    2. set
    3. get recordset (have varified that recordset actually has records and that the field names match
    - prior to step #4, the txtBox.Recordsource = the ADO recordset name
    - when set the following:
    .txtBox(1).datafield="fieldname"
    -->VB6 actually crashes.
    {I have verified the dataset has the correct field names; has data}

    What in the heck am I doing wrong.
    Last edited by ebtsup; Apr 12th, 2005 at 08:50 AM. Reason: Resolved

  2. #2
    New Member
    Join Date
    Apr 2005
    Posts
    7

    Re: Binding to TexBox With ADO ~ Crashes Vb6

    Do you use the SET to bind your AdoControl to your textbox ?

    set txtBox(1).datasource = adoControl

    txtBox(1).datafield="fieldname"

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Posts
    12

    Unhappy Re: Binding to TexBox With ADO ~ Crashes Vb6

    Yes: set it to set=me.txt.Datasource=me.rs1 (datasource name).
    When I then do
    me.txt.DataField="ID"

    VB6 actually crashes.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Posts
    12

    Re: Binding to TexBox With ADO ~ Crashes Vb6

    Actually, that turned out to be it...
    Even though we were doing the SET in code; the textbox initially had the same source assigned to it a design time.. which I guess is a "no-no."

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width