Solved

VB6 User Control and Data Source!

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now