Stripes1283
Programmer
Hi there I am having trouble getting the data from my excel file stored in my folder under c drive into the datagrid in vb6. I have the following code please help:
Dim oRS As New ADODB.Recordset
Dim cnn As New ADODB.Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\Werner\Ex1.xls;"
rs.Open "Select * from Ex1", cnn, adOpenStatic, adLockReadOnly, adCmdText
Set DataGrid1.DataSource = rs
Dim oRS As New ADODB.Recordset
Dim cnn As New ADODB.Connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\Werner\Ex1.xls;"
rs.Open "Select * from Ex1", cnn, adOpenStatic, adLockReadOnly, adCmdText
Set DataGrid1.DataSource = rs