Solved

VB6 User Control and Data Source!

Posted on 1998-11-17
3
238 Views
Last Modified: 2010-05-03
Hi,

I have written a generic user control which validates a user login.  It contains database references in the code, i.e. Dim db as database and rs as recordset which is the declarations for the lookup.  It then uses search methods to find the user and verify the password.

The problem I am having is when I run it in a separate test project I get a data source dialog asking me for DSN information!

When I run a similar piece of code stand alone in another project it works fine.  

Any ideas?

Regards one and all,

Jud.
0
Comment
Question by:jud
3 Comments
 
LVL 1

Expert Comment

by:yfang
ID: 1445257
Yes, some ideas but not a specific solution.  Do not worry about the points if this does not help you enough.

DSN means Distributed Server Network.  It looks like your database is designed as a distributed database.  This is why it works fine on a stand alone machine.  Please check the design of your database and documentation about distributed database.

Good luck!
0
 

Author Comment

by:jud
ID: 1445258
yfang, thanks for the reply.  the database isn't distributed, I meant stand alone project, not machine.  So, when I run code on this database in a standard EXE it works fine, but as soon as I make it into a user control and use it from another project, it comes up with this message.
0
 
LVL 8

Accepted Solution

by:
vettranger earned 50 total points
ID: 1445259
You get that dialog when VB can't find a value for the Databasename property of a database. You might try exposing a property from your usercontrol that you set with your databasename at runtime, and them use the value of that property when you open the database in your usercontrol.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

829 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