Solved

Use DbGrid in DAO ?

Posted on 1998-04-20
4
276 Views
Last Modified: 2012-06-27
How to use DbGrid control without Data control:

Set Mydb = OpenDatabase("c:\db\Mydb.mdb")
Set Myset = Mydb.OpenRecordset("Table1", vbOpenTable)
DbGrid1.DataSource = ????
0
Comment
Question by:username1
[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
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 50 total points
ID: 1425530
Username1.
I believe that You need a data control to use the dbGrid.
The dataSource property is not available at run time. It has to be set at design time.

For your case, you use the datacontrol for just use the dbgrid. (still use the DAO for other purpose).


    Set Mydb = OpenDatabase("c:\db\Mydb.mdb")
    Set Myset = Mydb.OpenRecordset("Table1", vbOpenTable)
    Set data1.RecordSet = Myset
    data1.Refresh

Hope it helped

Regards
Dalin
0
 

Author Comment

by:username1
ID: 1425531
Hi Dalin,

Thank you.

Do you mean I can not use any bound control without Data control?
The Data control is not avalable in VB5 trial versiion which is what I am using :-)
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1425532
UserName1,
Sorry...That is what Microsoft say...I wish I had better answer for you.
Regards
Dalin
0
 

Expert Comment

by:jhook010598
ID: 1425533
Not true you do not need a data control with your grid. And Microsoft does not say this. You just have to take control off the grid update yourself. Read up on unbound grids in the online books for vb 5.0. Read up on UnboundAddData, UnboundDeleteRow,UnboundReadData, UnboundWriteData. This takes a lot more work of course than a bound grid. But it can be done and gives you a lot more control and performance.
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

742 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