Solved

Restarting an app. back to start...

Posted on 2004-08-18
4
184 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
[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
  • 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
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…

695 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