bugs >> Data Controls not working in VB6

by amieoanh » Sun, 01 Jun 2008 13:11:10 GMT

I have a problem in a project using Data controls. My form contains 5
data controls and at run time I initialize the datasource controls
and set the recordset as follows:

datasource_benchmark_code.DatabaseName = database_file_name

Set datasource_benchmark_code.Recordset =
database_ref.OpenRecordset _
( _
"SELECT DISTINCT BenchmarkCode " & _
"FROM Merged_Data WHERE " & _
"BenchmarkCode <> '' " & _
"ORDER BY BenchmarkCode" _
)

As soon as this code gets executed, the program aborts and leaves no
error messages only with a popup to contact Microsoft with the
messages below:

Visual Basic has encountered a problem and needs to close. We are
sorry for the inconvenience.
Please tell Microsoft about this problem.

and the Send Error Report or Don't Send buttons.

If I just compile the program and run the .exe then it works. It's
only when I'm in design mode that the program fails.
Please help!!!

Thanks,
Amie


Similar Threads

1. Data Control Data Binding not work

I have a form that has a data control for record navigation, and a few 
text fields that are bound to the data control. Unfortunately, the data 
binding doesn't work for me.

I am using Visual Basic 6. The database is Access 2003. I tried Access 
97 but it didn't work either.

Following is the code and it generates the error: "Invalid use of 
property" on the line of "data_control.Recordset = sRS".

Any idea? Thank you.

---------------------
Private Sub Form_Load()
     Dim sq As String
     Dim sRS As ADODB.Recordset

     sq = "SELECT route_id FROM title"

     Set sRS = New ADODB.Recordset
     sRS.CursorLocation = adUseClient

     'gObjAccessConn is the global connection object already created
     sRS.Open sq, gObjAccessConn, adOpenStatic, adLockReadOnly, adCmdText

      data_control.RecordSource = gObjAccessConn
      data_control.Recordset = sRS

      txt_route_id.DataField = "route_id"
      txt_route_id.DataSource = data_control

End Sub
--------------

2. Save action on data control not working

3. Ax control works fine in VB6 but not in VB.NET

Would you consider this a bug if the ActiveX control works fine in VB6 but 
does not work at all in VB.NET.  I have almost the exact same code but run 
into all types of problems in VB.NET.

1. Sometimes the properties specific to the ActiveX control don't even show 
in the properties.

2. When the properties do show up, I can't set them in the designer without 
getting an "Object not set to an instance..." error. 

3. If I try creating, siting and working with the control strictly within 
code and not the designer; I get null reference exceptions.

Seems like a bug if VB6 can handle it and VB.NET can't.  

Thoughts?


4. VB6 ListView and ImageList Controls Not Working after Upgrade to V

5. Data Object Wizard - Single Record User Control does not place all fields on form - VB6

Hello --

When I add a blank form and double-click the uct... built by the Data 
Object Wizard, it places only 15 1/2 fields on the form, in a column. 
There are approx 125 fields in the table on which the uct is built.

The properties explorer shows that the uct contains all the fields in 
the table (as well as related labels).

Is there a way to automatically place more fields on the form?

Thanks for any help.

Larry Mehl

6. C dll reference/call works in VB6, not working in VB.NET - VB.Net

7. ADO DATA CONTROL not loading data

I have just distributed an application, it has the option of accessing both 
an Access DB and SQL Server. Everything works fine in both mode until I go 
to view any data in grids which use an ADO data control, it shows as 
nothing.

MDAC 2.8 is installed as part of the script, the actual data accessing and 
saving is fine

I distribute

MSBIND.DLL
MSADODC.OCX
MSSTDFMT.DLL

Thanks for any help in advance


8. Remote Data Control not consistantly retrieving data - Visual Basic/VB