Solved

VB6 & ADODC Using SQL

Posted on 1998-10-12
2
1,139 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
[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
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
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…

734 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