Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB6 & ADODC Using SQL

Posted on 1998-10-12
2
Medium Priority
?
1,167 Views
Last Modified: 2013-12-25
Using VB5 Ent., I have written a program using a number of controls (bound & unbound).  I've tried updating to VB6 Ent. using ADODC.  I have a DBCombo bound to a DAO control to load the contents into the list, which works fine with ADODC.  The problem is that I load a DB Grid with a second ADO data control using the bound text from the DBCombo.  When I try to assign the grid using sql on the second control without specifying a recordsource, I get an error stating same.  I can't use sql in the properties of the ADODC because it is reliant on the bound column of the DBCombo.

Any ideas would be great.

   
0
Comment
Question by:nu2vb
2 Comments
 
LVL 3

Accepted Solution

by:
TheAnswerMan earned 200 total points
ID: 1496847
What I usually do is Assign a SQL Statement that will return no rows.  IE "SELECT CompanyNumber From CompanyList WHERE CompanyNumber = "XXXX"
Then. the grid will be empty.
When the User Clicks on an Item in the Combo.. the Recordsource is
Select * from CompanyList WHERE CompanyNumber ='" & cboList & "'"

I also use this technique when I know the recordset is quite large, and I dont want the user to wait for it to load, just so they can select another one from the list.
0
 

Author Comment

by:nu2vb
ID: 1496848
Excellent!  
Something so simple and it works - Thanks for pointing it out.  I will also use it like you said - With large recordsets!

Thanks again.........
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 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…
Suggested Courses

782 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