Wrox Programmer Forums
|
BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5
This is the forum to discuss the Wrox book Beginning Visual Basic 2005 Databases by Thearon Willis; ISBN: 9780764588945
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 21st, 2006, 01:09 AM
Registered User
 
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch 10 :Data Access Component

Hi

As instructed by the book, in Ch 10 (Building the Business Logic and Data Access Components), while creating the Data Access Component, I have started creating the Solution in VB 2005. I first added a Windows Application to the Solution (to act as the UI) and then added a New Project of Type 'Class Library' to the Solution. This Class Library would act as the Data Access Component (DAC).

Both Projects appear in the Solution Explorer - the Windows Application UI and the DAC.I also Built the DAC and observed that the DLL was successfully created in the relevant directory.

However, in the UI, when I tried to declare a variable of the DABase class, I found that Intellisense did not display the DAC Class Library. Thus, I am not able to refer to the DLL, at design time.

On the other hand, INSTEAD of ADDING the DLL to the UI solution, if I simply create a single Project of Type 'Windows Application' (to act as the UI) and then, for this project, ADD a REFERENCE to the DAC DLL, then everything works PERFECTLY - I am able to declare a variable of a Class in the DAC DLL, because it appears in the Intellisense window.

I have the following questions :

1. When the 1st approach is followed, why am I unable to refer to
   the DAC DLL at design time ? In addition to adding the Class
   Library Project to the UI Project, do I also have to add a
   reference to the DLL ? The book doesn't mention this.

2. In the 1st place, why does the DAC DLL have to be ADDED to the UI
   Project ? Is this preferred to adding a Reference to the DAC DLL?
   Is this to simplify Deployment onto the Production environment,
   which might be a different machine ?

Thanks.

Steven
 
Old July 24th, 2006, 05:09 PM
Thearon's Avatar
Wrox Author
 
Join Date: Dec 2003
Posts: 396
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Steven,

Point 1 refers to adding an existing project to another project which is not permissable. Are you referring to adding the project to the solution that contains the UI project? You can however, add the appropriate DAC class to your UI project and then you would instantiate the class in your object. For example: Dim objDACClass As New DACClass.

Point 2, you do not want to add the class to your project. Assume you are working with a DLL that someone else wrote and you do not have the source code. In this case you need to add a reference to the DLL in order for your project to know about it. I think the previous statement answers your other questions about this point.

Thearon





Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Data Access Component (MDAC) Walden SQL Server 2000 3 September 4th, 2006 02:26 AM
Example of a SQL Data Access Component ? andrewba ADO.NET 4 August 9th, 2004 06:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.