Solved

DBGRID LOCKED

Posted on 1998-10-01
3
161 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

786 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