Solved

Restarting an app. back to start...

Posted on 2004-08-18
4
182 Views
Last Modified: 2010-05-02
Hello, I created an application that is basically a GUI(Front-end) to a SQL Server DB.  When the user double clicks the app to start, it pops up a login form.  If the user puts in the right password it continues and connects to the DB and populates the datagrid.  That is perfect, but when a user puts in the wrong username or password, I have an adodc_error routine that traps the error that was given by the ado object, but the gui still pops up but the datagrid and it isn't populated.  

When it errors out on a bad password or username, I want it to call the login form again, hide the main GUI (Where datagrid is) and start from the beginning again. Can someone give me some sample code helping me with this.

I have 2 forms.  1 form is the login form, the other is the GUI form.

I am using VB version 6.

Thanks
0
Comment
Question by:strongd
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:PePi
ID: 11832167
if an error occurs or a bad username or password was provided, don't load form 2. it would help if you can post your code.
0
 

Author Comment

by:strongd
ID: 11832623
My code is in form2, it pass's the user name and password to the adodc which is in form2.

0
 
LVL 6

Accepted Solution

by:
PePi earned 50 total points
ID: 11832821
why not move your code from from2 to form1. i mean, make the connection in form1 (which i assume is your login form). validate the username & password in form1. if correct username & password was provided, load form2 if not stay with form1 and allow another try to enter username & password.

create a module and declare your connection variables there. this will ensure that both your forms will have access to the connection.

good luck!
0
 

Author Comment

by:strongd
ID: 11833029
I can't believe I didn't think  of creating another module ...  I was trying to do everything in the forms...  Thanks...

I feel dumb now..

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

809 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