473,378 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem with displaying data through DataGrid control in VB

hello,
can some one pls help me about certain problem.Actually, i am using "datagrid" control of VB6.0 to display data with the help of ADODB recordset.
The back end is a MSACCESS table. I want to retrieve a specific row from this table and display in the DataGrid selectively. But following run time error is showing.
Error 7004
Recordset is not Bookmarkable.



Public adcon As New ADODB.Connection
Public rs As ADODB.Recordset


Private Sub Command1_Click()
adcon.ConnectionString = "DSN=gas"
adcon.Open
Set rs = adcon.Execute("Select * from detail1")
rs.Filter = "Consumer_Number='" & Trim(Text1.Text) & "'"

Set DataGrid1.DataSource = rs
DataGrid1.Refresh
End sub
Sep 24 '06 #1
2 7094
sashi
1,754 Expert 1GB
Hi there,

This a common error when dealing with DataGrid control, try to bind the DataGrid to a bookmarkable recordset such as the keyset and static ADO recordsets, hope it helps you to get started with, take care my fren.. :)
Sep 24 '06 #2
Hi,

Simple coding for DataGrid Problem

Click Components option from Project menu, Select DataGridControl and ADO Data Control and place these two controls on form and then give the following codings.
Expand|Select|Wrap|Line Numbers
  1. Dim db As String
  2. Private Sub Command1_Click()
  3. db = "d:\Sample\db1.mdb"   'DataBase Path
  4. Adodc1.ConnectionString = _
  5.         "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
  6.         "Data Source=" & db & ";"
  7. Adodc1.RecordSource = "SELECT * FROM table1 where cik='" + Text1.Text + "' " 
  8. Set DataGrid1.DataSource = Adodc1
  9. End Sub
Nov 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Bil Muh | last post by:
Esteemede Developers, I would like to Thank All of You in advance for your sincere guidances. I am developing a software using Visual C++ .NET Standard Edition with Windows Form (.NET)...
5
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order...
3
by: vinayak | last post by:
Hi I am displaying data in Datagrid in ASP.NET with Edit/Update functionality for each row. On the same page I have 2 Button controls which submits the request to server. These button controls...
0
by: Clement | last post by:
I have an user control(Control1) that dynamically adds another user control(Control2). In Control2, I am displaying data in a datagrid which I enable paging and sorting. When I click on the page...
0
by: Raed Sawalha | last post by:
I have aspx page with user control , in the user control i have DataGrid with custom paging the grid is displaying contents of datatable as following schema <xs:element name="id"...
1
by: .Net Sports | last post by:
the below itemdatabound function works , displays all the grand totals in the footer control of the datagrid: private void dglvboard_ItemDataBound(object sender,...
4
by: JJGarcia | last post by:
Hi Everyone, I'll try to explain the process I'm following, I'm new to this so I'm triying the easy way first, probably the lasyest too! I created a new Project, drag in to it a SQLConnection,...
14
by: marinho80 | last post by:
Hoping someone has experienced this before and can offer a solution. I have an app. that was designed in vb6. The app works with data from a SQL server, retrieves the data using the adodc...
0
by: webaccess | last post by:
Hi Friends ..!! I want to use datagrid/dataview control to data in tablular format,also I want to add paging and format the data of table column. Problem is data is coming from API Dom in as...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.