?
Solved

Use DbGrid in DAO ?

Posted on 1998-04-20
4
Medium Priority
?
280 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 200 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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
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…
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…
Suggested Courses

801 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