Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21212

Data Grid Issue

$
0
0
Friends,

I wrote the following code;

Private Sub Form_Load()
'On Error Resume Next
Dim id As String
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\db2.mdb;Persist Security Info=False"
Adodc1.RecordSource = "select * from table1"
id = Text1.Text
Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\db2.mdb;Persist Security Info=False"
Adodc2.RecordSource = "SELECT * FROM TABLE2 where ID='" & id & "'"
Set DataGrid1.DataSource = Adodc2
Adodc2.Recordset.Sort = "ID"
End Sub

But DataGrid shows all the record instead of ID. Because SELECT * FROM TABLE2 where ID='" & id & "'" is not working....

Please advise me.

Guna

Viewing all articles
Browse latest Browse all 21212

Trending Articles