Results 1 to 2 of 2

Thread: Datagrid Control ADO

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Posts
    5

    Post

    Hi,
    Does anyone know how to set the datagrid
    to an existing ADODB Recordset?

    I've been trying the following but nothing happens :-

    set datagrid1.datasource = rs

    Any help would be very welcome

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    This code works fine for me:

    Code:
        Dim cn As ADODB.Connection
        Dim rs As New Recordset
       
        Set cn = New Connection
        
        cn.Open "Provider=SQLOLEDB.1;Data Source=NTSRV;Integrated Security=SSPI;Initial Catalog=Northwind"
        
        rs.Open "Select * from customers", cn, adOpenStatic, adLockReadOnly
                
        Set Me.DataGrid1.DataSource = rs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width