Private Sub Form_Load()
Dim sqlstr As String
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim rs As New ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=" & App.Path & "/database.db;"
conn.Open
rs.Open "SELECT * FROM tblGiat", conn, adOpenKeyset
MsgBox "Total Number of records = " & rs.RecordCount
End Sub
He conectado exitosamente la base de datos a VB6. Ahora necesito ayuda sobre cómo mostrar esa base de datos en DataGrid.
Respuesta1
Private Sub Form_Load()
Dim sqlstr As String
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
Dim rs As New ADODB.Recordset
Set conn = New ADODB.Connection
conn.ConnectionString = "DRIVER=SQLite3 ODBC Driver;Database=" & App.Path & "/database.db;"
conn.Open
rs.Open "SELECT * FROM tblGiat", conn, adOpenKeyset
MsgBox "Total Number of records = " & rs.RecordCount
Set DataGrid1.DataSource = rs
End Sub