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.
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"
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.
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