Normally, when using a DataGrid, or any other complex data bound object with an ADO recordset created using the JET OLEDB Data provider, you needed to use a Client Side Cursor in order for data to be displayed in the grid.
This is because the JET OLEDB provider does not support the DBPROP_LITERALIDENTITY property.
However, there is a method to get it to use a Server side cursor. Jet needs to implement IRowsetIdentity.
You need to set your connection, cursorlocation and type along with setting the JET IRowsetIdentity property prior to opening the recordset.
Please note that the IRowsetIdentity property needs to be set after the connection is set, otherwise there will not be a connection to the JET provider through ADO in order to set retrieve/set any properties:
With rsADO
.CursorLocation = adUseServer
Set .ActiveConnection = conn
.CursorType = adOpenKeyset
.Properties("IRowsetIdentity"
.Source = "SELECT * FROM myTable"
.Open
End With
Set DataGrid1.DataSource = rsADO
I just thought that this may make some people happy.... [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!