|
-
Apr 12th, 2005, 07:40 AM
#1
Thread Starter
New Member
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
-
Apr 12th, 2005, 07:57 AM
#2
New Member
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"
-
Apr 12th, 2005, 08:06 AM
#3
Thread Starter
New Member
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.
-
Apr 12th, 2005, 08:49 AM
#4
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|