Hi all
I've had very little luck in finding a solution to my problem. From what i can see it should be relatively simple. I am looking to populate a Tru DB grid from a ADODB record set but i cannot get it working. The code i have so far is this and i thought that this is all that would be required.
Option Explicit
Private cn As ADODB.Connection 'this is the connection
Private rst As ADODB.Recordset 'this is the recordset
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= T:\CIS Version Control Database\CISVersionControl.mdb"
cn.Open
cn.CursorLocation = adUseClient
Set rst = New ADODB.Recordset
rst.Open "sitedetails", cn, adOpenKeyset, adLockPessimistic, adCmdTable
TDBGrid1.DataSource = rst
TDBGrid1.Refresh
End Sub
Sitedetails is the table within the database that is opened via the connectionstring cn.
Any help would be much appreciated.
Thanks
I've had very little luck in finding a solution to my problem. From what i can see it should be relatively simple. I am looking to populate a Tru DB grid from a ADODB record set but i cannot get it working. The code i have so far is this and i thought that this is all that would be required.
Option Explicit
Private cn As ADODB.Connection 'this is the connection
Private rst As ADODB.Recordset 'this is the recordset
Private Sub Form_Load()
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source= T:\CIS Version Control Database\CISVersionControl.mdb"
cn.Open
cn.CursorLocation = adUseClient
Set rst = New ADODB.Recordset
rst.Open "sitedetails", cn, adOpenKeyset, adLockPessimistic, adCmdTable
TDBGrid1.DataSource = rst
TDBGrid1.Refresh
End Sub
Sitedetails is the table within the database that is opened via the connectionstring cn.
Any help would be much appreciated.
Thanks