FUBAR
Jan 6th, 2000, 09:12 AM
I have had a slew of problems using ADO controls with MS Jet 4.0 or 3.51 providors connecting to Access 97 databases using VB 6.0 Enterprise Edition SP3 MDAC 2.1 SP2
My application uses an ADODC control to retrieve all or selected records from a table. From what I've read regarding troubleshooting these problems I am now using use OpenKeyset, Client side cursors, and ShareDenyNone (or other optomistic approaches).
There's not much code to it so I thought I'd explain the basic approach I'm taking before providing that.
I have text boxes bound to fields in the ADODC to display the current record values, I use MHSFlexGrids or DataLists bound to the same ADODC to navigate between records.
To recreate this problem simply create an Access 97 (sp2) database with each of the following field types:
Date,Time,Integer,Double,Single,Boolean(Yes/No) and AutoNumber (long integer no duplicates) as the primary key.
Create a new VB project with a form containing all the aforementioned controls and data providors. Create a couple of buttons and add code for: me.adodc1.recordset.addnew (New Button)
me.adodc1.recordset.update (Save Button)
me.adodc1.recordset.delete (Delete Button)
(put a quit button in there to close your form and end your project)
If you realy want to get into it make code for a dbl_click event on the datalist control to move to the record selected (I use the AutoNumber field to make it especially hard on myself)
I generally have to use a SQL query (cmdText) as opposed to a Table type or I get smothered in errors. Additionally I have to use jet 3.51 as opposed to 4.0
When using Jet 4.0 I get a "run-time error -2147217887 Cannot update '(expression)' field not updateable" when attempting to use any of the adodc.recordset operation such as movefirst, addnew, find, etc...
3.51 works better but I get "Field not updateable" errors for the bound text box on the AutoNumber field as well as occasional "Disk or Network Error.16389" when attempting to open the form and thus execute the SQL query.
Sorry about being verbose on explaining this problem. Im new to this message board, I hope you'll forgive me.
Things to note:
I included all these different field types because I found it was very important to maintain the same formatting applied in the Access 97 table as the VB 6.0 form (and in some cases with date fields I even had to set regional settings for the OS)
Why Don't I use ODBC (still learning and) ODBC timeouts when querying multiple tables in a single SQL statement (how do you evaluate how long it should take?)
Thanks for any help I've been pretty frustrated with the whole thing...
My application uses an ADODC control to retrieve all or selected records from a table. From what I've read regarding troubleshooting these problems I am now using use OpenKeyset, Client side cursors, and ShareDenyNone (or other optomistic approaches).
There's not much code to it so I thought I'd explain the basic approach I'm taking before providing that.
I have text boxes bound to fields in the ADODC to display the current record values, I use MHSFlexGrids or DataLists bound to the same ADODC to navigate between records.
To recreate this problem simply create an Access 97 (sp2) database with each of the following field types:
Date,Time,Integer,Double,Single,Boolean(Yes/No) and AutoNumber (long integer no duplicates) as the primary key.
Create a new VB project with a form containing all the aforementioned controls and data providors. Create a couple of buttons and add code for: me.adodc1.recordset.addnew (New Button)
me.adodc1.recordset.update (Save Button)
me.adodc1.recordset.delete (Delete Button)
(put a quit button in there to close your form and end your project)
If you realy want to get into it make code for a dbl_click event on the datalist control to move to the record selected (I use the AutoNumber field to make it especially hard on myself)
I generally have to use a SQL query (cmdText) as opposed to a Table type or I get smothered in errors. Additionally I have to use jet 3.51 as opposed to 4.0
When using Jet 4.0 I get a "run-time error -2147217887 Cannot update '(expression)' field not updateable" when attempting to use any of the adodc.recordset operation such as movefirst, addnew, find, etc...
3.51 works better but I get "Field not updateable" errors for the bound text box on the AutoNumber field as well as occasional "Disk or Network Error.16389" when attempting to open the form and thus execute the SQL query.
Sorry about being verbose on explaining this problem. Im new to this message board, I hope you'll forgive me.
Things to note:
I included all these different field types because I found it was very important to maintain the same formatting applied in the Access 97 table as the VB 6.0 form (and in some cases with date fields I even had to set regional settings for the OS)
Why Don't I use ODBC (still learning and) ODBC timeouts when querying multiple tables in a single SQL statement (how do you evaluate how long it should take?)
Thanks for any help I've been pretty frustrated with the whole thing...