Solved

Use DbGrid in DAO ?

Posted on 1998-04-20
4
273 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
  • 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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

680 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