Solved

DBGRID LOCKED

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now