ado recordset error 
Author Message
 ado recordset error

Hello All,
I am new to designing in vb and have what may be a very rudamentary
question, but I just can't figure it out. I have created an app with
multiple ado controls on the same form. I want to create the recordset in
the actual code rather than the properties pages. Is this possible? If so,
how?

Any help is GREATLY appreciated.

Thanks,
Jerry



Sun, 13 Jul 2003 07:20:15 GMT  
 ado recordset error
It's possible. Take look at the sample I brought below. And don't miss the
point that connetcion and recordset objects in ADO can be created with events.

Option Explicit
Dim WithEvents objConn As ADODB.Connection
Dim WithEvents objRS As ADODB.Recordset

Private Sub Form_Load()
    Set objConn = New ADODB.Connection
    Set objRS = New ADODB.Recordset

    objConn.ConnectionString = "DSN=myDSN"
    objConn.Open

    objRS.Open "SELECT * From myTable", objConn
    Set me.Text1.DataSource = objRS
    Set me.Datagrid1.DataSource = objRS.DataSource
End Sub

Private Sub Form_Unload(Cancel As Integer)
    ojbRs.Close
    Set objRs = Notihng
    objConn.Close
    Set objConn = Nothing
End Sub

Quote:

> Hello All,
> I am new to designing in vb and have what may be a very rudamentary
> question, but I just can't figure it out. I have created an app with
> multiple ado controls on the same form. I want to create the recordset in
> the actual code rather than the properties pages. Is this possible? If so,
> how?

> Any help is GREATLY appreciated.

> Thanks,
> Jerry



Sun, 13 Jul 2003 20:28:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Opening ADO recordset error help !

2. HELP please - ADO recordset error

3. Ado Recordset Error

4. Ado recordset Error: Invalid use of Null

5. open ADO recordset - Error

6. Opening ADO recordset error ??

7. Un-Wanted ADO Recordset Error Message

8. ADO Recordset Error '3001: Arguments are of the wrong type...."

9. Ado Recordset Error. Help...

10. ADO Recordset Error '3001: Arguments are of the wrong type...."

11. ADO Recordset Error '3001: Arguments are of the wrong type...."

12. Open ADO recordset on another ADO recordset - possible?

 

 
Powered by phpBB® Forum Software