Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: ADO and DataGrid?


Message #1 by "Philip.Ware" <Philip.Ware@e...> on Wed, 27 Sep 2000 12:37:03 +0100
Hi,

How can I connect the DataGrid DataMember and DataSource properties to my
dynamically created ADO objects?

  ' the connection to the eeprom database
  Public DBConn_MT8850A_EEProm As New ADODB.Connection

  ' the eeprom table
  Public DB_MT8850A_EEprom_Data As New ADODB.Recordset

  ' open the ado connection
  DBConn_MT8850A_EEProm.Provider = "Microsoft.Jet.OLEDB.4.0"
  DBConn_MT8850A_EEProm.ConnectionString = "Data Source=" &
Files_Config.EEProm_Database
  DBConn_MT8850A_EEProm.Open

  ' Open the table 
  DB_MT8850A_EEprom_Data.Open "Select * From EEPromData",
DBConn_MT8850A_EEProm, adOpenStatic, adLockOptimistic

  ' Try to get the datagrid to display the contents of the recordset
  Set EEPromGrid.DataSource = DB_MT8850A_EEprom_Data
  EEPromGrid.DataMember = "EEPromData"
  EEPromGrid.ClearFields
  EEPromGrid.ReBind

Is this possible? Instead of using the dataenvironment controls?


Thanks,
Phil.

  Return to Index