Solved

datagrid control 6.0

Posted on 2001-06-26
7
183 Views
Last Modified: 2010-05-02
Hi
 Can someone please help me out with this problem.
It is like this.
I am using ado data control to link a datagrid control to a ms access database table.
How can I do it by only using code and not ado data control. It should be like this
1) In the beginning it should be blank to allow the user to input data
2) Then the user can click on a command button to save data to the table in the database
3)Then the user can use one of the fields(maybe primary key) to retrieve the data and display it on the datagrid.
But it should be by using only code not ado data control

thanks

0
Comment
Question by:bimalprakashsharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:TomLaw1999
ID: 6228993
The bast way to learn database programming is by example and Microsoft has provided a data programming generator in VB6 that explains what to do.

1) Click on add-ins
2) Select add-in manager
3) Select VB6 data form wizard.

A coded ADO program complete with data control can be generated very quickly and easily.

p.s. Just in case the add-in is not available on your version the code you require is available from the microsoft site www.microsoft.com and there are a number of excellent examples on www.planetsourcecode.com.

Best of luck with your project.
0
 

Expert Comment

by:bppraveen001
ID: 6230924
Hello bimalprakashsharma,

1) Add DataGrid component to your project (by using Project -> Components) and add it to the form where you want(also add other components that you want for the form).
2) Take reference to Microsoft ActiveX Data Objects 2.5 (ADO 2.5) to the project.
3) After the user entered the details and when he clicks on the Submit button take the connection to Database and store the information in the table (by using either ADODB.Command or ADODB.Recordset object or if you have any stored procedure which does the work of storing the values into database(table) ) after that execute one select state like :
  Select Field from table
and execute the statement. If there are any recrods in the table  ADODB.Recordset object will contain the result set then you issue the following command :
  Set DataGrid1.DataSource=objRecordSet
  DataGrid1.Refresh
This will store the resultset values.

After this you write the code in on click of the DataGrid and findout on which row user has clicked then take the value of the corresponding row and do the remaining task that you want to do.

bpp
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6231460
bppraveen001, you are not new to this site so should be familiar with the protocol. It is not good practice to lock questions in this way by using the "answer" option. Please read the guidelines on comments vs answers at the bottom of this page.

bimalprakashsharma: Please close out the ungraded thread http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20085950 you are still active on this site and a failure to maintain your questions is sufficient grounds for suspension of your account.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:bimalprakashsharma
ID: 6232826
I cannot enter anything into the datagrid control unless I bind it to ADO data control. Even if I set the allow add new to true..............
0
 
LVL 4

Accepted Solution

by:
TomLaw1999 earned 200 total points
ID: 6232950
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6710106
Please update and finalize ALL your open questions at this site.  Site Guidelines and Member Agreement as well as details on the Question/Answer process are available from the HELP DESK link on the left.

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6724216
bimalprakashsharma ----->  You last logged on 01/07/02, and have open questions you have not updated/finalized, some of which date back to early last year.

PLEASE UPDATE ALL YOUR OPEN QUESTIONS and add comments if more is needed, and award the experts who have helped you to close them.

If you need help in splitting points or for other actions, please comment and I will respond as quickly as I can.

I am adding this to all your open questions to make it easier for you to find them and update them.

Thank you,

Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question