Can't you just set the recordset property of the ado data control? The
following
code seems to work fine... Is this what you need, or am I missing something?
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
' open data connection and open recordset
cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & App.Path &
"\db1.mdb;"
rs.Open "select * from tblTest", cn, adOpenStatic, adLockReadOnly
Set Adodc1.Recordset = rs
Adodc1.Refresh
' display the nr of rows in the recordset
MsgBox Adodc1.Recordset.RecordCount
' kill objects
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
Jurgen
how?Quote:> Can an ado recordset be directly bound to an ado data control? If so,
> Can't you just set the recordset property of the ado data control? The
> following
> code seems to work fine... Is this what you need, or am I missing something?
> Dim cn As ADODB.Connection
> Dim rs As ADODB.Recordset
> Set cn = New ADODB.Connection
> Set rs = New ADODB.Recordset
> ' open data connection and open recordset
> cn.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=" & App.Path &
> "\db1.mdb;"
> rs.Open "select * from tblTest", cn, adOpenStatic, adLockReadOnly
> Set Adodc1.Recordset = rs
> Adodc1.Refresh
> ' display the nr of rows in the recordset
> MsgBox Adodc1.Recordset.RecordCount
> ' kill objects
> rs.Close
> cn.Close
> Set rs = Nothing
> Set cn = Nothing
> Jurgen
> > Can an ado recordset be directly bound to an ado data control? If so,
> how?
1. Bound controls not updating ADO with adodc.recordset.update command
I have a form with several text boxes as part of a control array. Each is
bound to one of two ado data controls. The data controls are part of a
control array also, adodc(0) and adodc(1). In my Lost Focus event of the
text boxes I have the statement, adodc(Index).Recordset.Update. Sometimes it
updates the database and sometimes it doesn't. Any ideas?
2. Looking for software engineers to develop landmark Web Service
3. Data bound controls using Adodc and ADO connection object
4. How to drop an unnamed uniqueness constraint in SQL?
5. ADO Data control bind to ADO DataGrid
7. How to bind ADO data bound controls in Visual C++
8. How to copy WebDB from 1 instance to another
9. ADO Data Control and Bound Controls
10. Data Binding with ADODC y ADO DATAGRID
11. First Cell Empty in Data Grid bound to ADO Data Control
12. Strange ADODC ActiveX Data Control (ADO) DataControl Error
13. ADO code generated recordset and binding to form controls