PDA

Click to See Complete Forum and Search --> : ADODB .vs. ADODC1 w/DataRepeater


MJN
Jan 28th, 2000, 03:39 AM
DataRepeater doesn't show AddNew record when ADODB Where/Filter starts w/0 recs selected, but ADODC1 does.

1. Follow MSDN instructions to create ProductsCtl.CtlProducts.OCX (search on Datarepeater).
2. Go to AxData folder and open and create OCX from MyData example.
3. Create new Project/Form and add DataRepeater1, MyData1, Command1.
4. MyData1 ConnectionString = NwDSN (simple User Dsn, using Microsoft Access Driver) that points to VB98\NWIND.MDB.
5. MyData1 RecordSource = Select * From Products WHERE ProductName = “XYZ” or Select * From Products and add filter logic to Form_Load() so that zero records are selected.
6. Follow MSDN instructions to finish DataRepeater1 setup (e.g. Bind ProductName, UnitPrice, etc.).
7. Place AddNew logic in Command1_Click().

When you run this form, the DataRepeater will be empty (as expected). When you press the Command1 button, the repeater still remains empty (not allowing you to edit the new record in the cache).

This is only a problem when you have zero records displayed in the repeater. If you have one or more records displayed in it, it works fine.

If you use ADODC1, instead of MyData1 as your DataSource, there isn’t a problem. But, for design reasons, I would like to use my own custom version of MyData (which will use ADODB Connection, Recordset, etc.

It also seems, if this is of any help, that ADODC doesn’t work the same as ADODB. For example, when you do an AddNew, the record count in ADODC will increase by 1, but not with ADODB. Is there some type of embedded logic in ADODC that treats the cache differently?

Any light you can shine on this problem would be greatly appreciated.

Thanks,

MJN