‘ Open an ADO DB connection toward SQL Server’s Pubs
Dim adoCn As New ADODB.Connection() adoCn.Open(OledbPubsConnString) ‘ Read the Publishers table using a firehose cursor. Dim adoRs As New ADODB.Recordset() adoRs.Open(“SELECT * FROM Publishers", adoCn) ‘ Use the Recordset to fill a DataSet table. Dim ds As New DataSet() Dim da As New OleDbDataAdapter() database. ‘ (The following line automatically closes the Recordset.) da.Fill(ds, adoRs, “Publishers”) adoCn.Close() |