like I ask you befor I try to use both the connection but highlite this code
Call Adodc1.Recordset.ActiveConnection
I need to open this query by using button click. like usual I need your support please .
Thank you in advance
Expand|Select|Wrap|Line Numbers
- Dim cn As New ADODB.connection
- Dim rs As New ADODB.Recordset
- Private Sub cmdnext_Click()
- rs.MoveNext
- If rs.BOF Then rs.MoveNext
- rs.EOF = rs.MoveFirst
- MsgBox "go to next record", vbInformation
- Call Adodc1.Recordset.ActiveConnection
- End Sub
- Private Sub cmdshow_Click()
- Set cn = New ADODB.Connection
- cn.Provider = "Microsoft.jet.oledb.4.0; "
- cn.Open "C:\HRMS\RTAHR "
- Set rs = New ADODB.Recordset
- rs.Open "select*from qryage", cn, adOpenDynamic, adLockOptimistic
- Show
- Call Adodc1.Recordset.ActiveConnection
- End Sub