jack208
asked on
VB6, ADO, MSDataGrid and Data Environment
I used VB6, ADO and Data environment and I've the following codes in my program:
FORM_LOAD
envApplication.comCustomer List
Set grdMain.DataSource = envApplication
grdMain.DataMember = "comCustomerList"
where env = Data Environment
grd = MS Data Grid ver 6
com = Data Env Command objects
IT works fine and correctly populates my datagrid with the relevant list of records from the customer table. Now I'd like to have a REFRESH button that requeries the underlying recordset and updates the datagrid.
My code looks like this:
CMDREFRESH_CLICK
envApplication.rscomCustom erList.clo se 'closes the recordset
envApplication.comCustomer List 'reopens it
grdMain.DataMember = "comCustomerList" rebind to datagrid
Many people I asked had told me this code should work. My problem is that the program crashes at the last line (grdMain.DataMember = "comCustomerList") with fatal error on MSDATGRD.OCX or sometimes MSADO15.DLL
An alternative code will be:
CMDREFRESH_CLICK
envApplication.rscomCustom erList.Req uery
In this case, it'll crash right away!! Someone even send me his working program using the same codes, but I still get the same errors running it on my PC. Which brings me to suspect that the problem may not be in the "codes" but is in the system files (OCXs or DLLs) in my computer's configuration, or even a bug in the DataGrid itself. Has anyone faced similar problems?
Thanks and Merry Christmas.
FORM_LOAD
envApplication.comCustomer
Set grdMain.DataSource = envApplication
grdMain.DataMember = "comCustomerList"
where env = Data Environment
grd = MS Data Grid ver 6
com = Data Env Command objects
IT works fine and correctly populates my datagrid with the relevant list of records from the customer table. Now I'd like to have a REFRESH button that requeries the underlying recordset and updates the datagrid.
My code looks like this:
CMDREFRESH_CLICK
envApplication.rscomCustom
envApplication.comCustomer
grdMain.DataMember = "comCustomerList" rebind to datagrid
Many people I asked had told me this code should work. My problem is that the program crashes at the last line (grdMain.DataMember = "comCustomerList") with fatal error on MSDATGRD.OCX or sometimes MSADO15.DLL
An alternative code will be:
CMDREFRESH_CLICK
envApplication.rscomCustom
In this case, it'll crash right away!! Someone even send me his working program using the same codes, but I still get the same errors running it on my PC. Which brings me to suspect that the problem may not be in the "codes" but is in the system files (OCXs or DLLs) in my computer's configuration, or even a bug in the DataGrid itself. Has anyone faced similar problems?
Thanks and Merry Christmas.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.