Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VB6 User Control and Data Source!

Posted on 1998-11-17
3
Medium Priority
?
252 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 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
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…
Suggested Courses

963 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