Click here to Skip to main content
13,557,962 members
Rate this:
Please Sign up or sign in to vote.
See more:
I want to populate datagrid use a SQL Query. I don't want to use ADODC kind of control.

Please suggest.
I wrote the coding but it's not working.

Dim db As ADODB.Connection
Dim rs As ADODB.Recordset

Set db = New ADODB.Connection
Set rs = New ADODB.Recordset
Dim str As String
str = "Select * from table1"
db.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\db1.mdb"
Set rs = db.Execute(str)

Set DataGrid1.DataSource = rs

Error is saying RowSet is not bookmarkable

Any other code segment will also helpful for me.

I just want to populate the datagrid using a SQL Query.

Please Help
Posted 8-Jun-11 10:11am
Updated 11-Apr-17 2:07am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can solve it by adding CursorLocation = adUseClient

Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
Sourav-Sarkar-SS 9-Jun-11 0:48am
can you tell me, what the above line will do?
Amit-Kumar-Tiwari 9-Jun-11 4:26am
Read the article for detail @
Sourav-Sarkar-SS 9-Jun-11 12:07pm
Thank you so much

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180515.1 | Last Updated 11 Apr 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100