Solved

DBGRID LOCKED

Posted on 1998-10-01
3
164 Views
Last Modified: 2006-11-17
I know this must be easy but here it goes.  I have a db grid that I am running various sql statements as data1 recordsource.  This works fine. all I really want to be able to do is at one point make the datagrid so it is not bound to a datacontrol by pressing a button or by using a if then statement, etc

I would like to do this so i can make the datagrid blank, also I want to make it so the table in the database is not bound to any control in VB.  

Idea's?
0
Comment
Question by:CURIOUS1
[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
  • 3
3 Comments
 
LVL 3

Accepted Solution

by:
TheAnswerMan earned 50 total points
ID: 1437656
You can use the GetRows function of an RDO Resultset to pass the resultset into an Array.

then the Grid Will be blank until you decide that you want to fill it with data.

It is a simple matter of using a Do while Loop to Build the Grid as you like.

dim x as long
dim li_Row as Long
Dim li_Col as integer

x = UBound(TheArray(2))-1  'The number of columns
                          'Do This here instead of inside
                          'first loop, otherwise VB has to
                          'Calculate the 'RowCount' for every row

For y = 0 to UBound(TheArray(1))
   For li_col = 0 to x      
     'Assign Whatever Cell you want = TheArray(li_Row,li_col)
   Next y
Next y
0
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1437657
The other King thing about the Unbound it that it doesn't add an extra connection<For Each Data Control> to the Server, since these connections arent free.  If your app is multi user.. this can make a big difference.  
Also, since you don't have to open a new connectiont to the database for a Control, Your form probably will load faster, making for a snappy appearance.
0
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1437658
The other King thing about the Unbound it that it doesn't add an extra connection<For Each Data Control> to the Server, since these connections arent free.  If your app is multi user.. this can make a big difference.  
Also, since you don't have to open a new connectiont to the database for a Control, Your form probably will load faster, making for a snappy appearance.
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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

690 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