am using vb6
but i can't hwo to vie the data base content in data grid
Here is my code
Dim cn1 As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim ser As String
ser = ("select * from student where ID='" & Text5.Text & "'")
Set cn1 = New ADODB.Connection
cn1.Provider = "Microsoft.Jet.OLEDB.4.0"
cn1.Open "F:\Personal\Sumith\Study\My project\Vb project\adodc conection through code\student.mdb"
Set rs1 = New ADODB.Recordset
rs1.Open ser, cn1, adOpenStatic
If rs1.EOF And rs1.BOF Then
MsgBox "No record found"
End If
Set DataGrid1.DataSource = rs1
DataGrid1.Refresh
snairsumith 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.