VB6/SQL Server 7 problem - VB Data Environment

VB6/SQL Server 7 problem - VB Data Environment

Post by Larry Calam » Fri, 24 Mar 2000 04:00:00



Please help!

My company is in the throws of our first delivery of a VB6/SQL Server 7
project. We took a hit with the use of ado data controls we used to bind
combo boxes - each data control created its own connection and our client
ran out of connections!

We then migrated all the combo box bindings to separate stored procedures in
a single connection of a data environment object. The connection problem was
mitigated, but NOW....

When users open, close, then re-open some of the forms, the combo boxes
display the numbers stored with the associated record/field, not the text
from the corresponding stored procedure/lookup table value. It is as if the
data source (to the underlying record) is intact, but the row source (to the
stored procedure/lookup table) is broken.

I have tried code that refreshes (closes/opens) the connection, re-opens the
stored procedure's recordset, and rebinds the combo box - with decidedly
mixed results.

Any thoughts or ideas would be GREATLY appreciated!!

Larry Calame
Accent Business Services, Inc


 
 
 

VB6/SQL Server 7 problem - VB Data Environment

Post by Ray Wrigh » Fri, 24 Mar 2000 04:00:00


When I need to populate comboboxes, I do the following:
   1.  Open a connection to the database
   2.  Create a recordset using an SQL select statement to select the data.
   3.  Loop until the recordset.eof is true
   4.  use additem to add it to the combobox
   5.  close the connection.

I put this into a procedure and call it whenever I need to load the
combobox.  The first statement is .clear to clear the combobox, to prevent
the items from being added multiple times.

Hope this helps.


> Please help!

> My company is in the throws of our first delivery of a VB6/SQL Server 7
> project. We took a hit with the use of ado data controls we used to bind
> combo boxes - each data control created its own connection and our client
> ran out of connections!

> We then migrated all the combo box bindings to separate stored procedures
in
> a single connection of a data environment object. The connection problem
was
> mitigated, but NOW....

> When users open, close, then re-open some of the forms, the combo boxes
> display the numbers stored with the associated record/field, not the text
> from the corresponding stored procedure/lookup table value. It is as if
the
> data source (to the underlying record) is intact, but the row source (to
the
> stored procedure/lookup table) is broken.

> I have tried code that refreshes (closes/opens) the connection, re-opens
the
> stored procedure's recordset, and rebinds the combo box - with decidedly
> mixed results.

> Any thoughts or ideas would be GREATLY appreciated!!

> Larry Calame
> Accent Business Services, Inc




 
 
 

VB6/SQL Server 7 problem - VB Data Environment

Post by Roal Zanazz » Fri, 24 Mar 2000 04:00:00



Quote:> Please help!

> My company is in the throws of our first delivery of a VB6/SQL Server 7
> project. We took a hit with the use of ado data controls we used to bind
> combo boxes - each data control created its own connection and our client
> ran out of connections!

> We then migrated all the combo box bindings to separate stored procedures
in
> a single connection of a data environment object. The connection problem
was
> mitigated, but NOW....

> When users open, close, then re-open some of the forms, the combo boxes
> display the numbers stored with the associated record/field, not the text
> from the corresponding stored procedure/lookup table value. It is as if
the
> data source (to the underlying record) is intact, but the row source (to
the
> stored procedure/lookup table) is broken.

> I have tried code that refreshes (closes/opens) the connection, re-opens
the
> stored procedure's recordset, and rebinds the combo box - with decidedly
> mixed results.

> Any thoughts or ideas would be GREATLY appreciated!!

DON'T use ADO data control!!!

Use a temporary ADODB.Recordset instead, fill the combo, then close the
recordset.

--
Roal Zanazzi