Solved

VB6 & ADODC Using SQL

Posted on 1998-10-12
2
1,121 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 50 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

828 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