Solved

VB6 User Control and Data Source!

Posted on 1998-11-17
3
243 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
[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
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

751 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