|
-
Feb 27th, 2007, 05:15 AM
#1
Thread Starter
New Member
ado connection and datagrid error
recorded datas seem on datagrid on the connection in form_load procedure
but when i connected to access database in text1_change procedure ,the datas are not being seemed,what is the problem or the code that ı didnt add?
<code>
(general declerations)
------------------------
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
(form load)
-----------
Set rs = New ADODB.Recordset
rs.Open "select * from abc order by a asc ", con, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = rs
set DataGrid1.Columns(0).Datafield="a"
DataGrid1.Columns(0).Caption="a"
set DataGrid1.Columns(0).Datafield="b"
DataGrid1.Columns(0).Caption="b"
set DataGrid1.Columns(0).Datafield="c"
DataGrid1.Columns(0).Caption="c"
Text1.Text = ""
(text1_change)
--------------
Set rs = New ADODB.Recordset
rs.Open "select * from abc where a like '"& text1.text & "%' order by a asc ", con, adOpenKeyset, adLockOptimistic
Set DataGrid1.DataSource = rs
--------------------------------------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|