Solved

litltle help on designing a login network

Posted on 2001-06-04
6
195 Views
Last Modified: 2010-04-06
hi

am trying to design a login network an I have tried to use gotokey technique but am having a little problem which am hoping you can help. I am using Delphi V4 Paradox 7 and I have tried to use the following code....

with Table1 do
begin
Table1.Open;
     with Table1 do begin
          SetKey;
          FieldByName('UserName').AsString:=              
          UserComboBox.Text;
          FieldByName('Password').AsString:=
          PasswordEdit.Text;
          GotoKey;
          if not Table1.GotoKey then begin
          MessageDlg('User Not Found! Please Check and
                     Try Again.', mtError, [mbOK], 0);
         
          end else
          if Table1.GotoKey then begin
             if FieldByName('User').AsString = 'Manager'  
             then
             button1.enabled:=true;
             end else
          if Table1.GotoKey then begin
             if FieldByName('User').AsString = 'Sales
             Staff' then
             button2.enabled:=true;
          end else

          if Table1.GotoKey then begin
             if FieldByName('User').AsString = 'Stock
             Controller' then                
             button3.enabled:=true;
          end;
end;


am using the DBCombobox and DBEdit to store password and username and then am using the TComboBox and TEdit when searching for record.

can someone tell me what am i doing wrong or is there another way of doing this.

Thank you
0
Comment
Question by:Delphiboy
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:martin_g
ID: 6152481
And the problem is?
0
 

Author Comment

by:Delphiboy
ID: 6152746
I got this error message when I tired to test this code. For instance if I select Manager from TComboBox and enter password in TEditbox button1 should be enabled, but I have this error message...

Project Project1.exe raised exception class EDatabaseError with message ?Field Password? is not indexe and cannot be modified?.



What am I doing wrong?

0
 
LVL 1

Accepted Solution

by:
martin_g earned 50 total points
ID: 6153031
You need to index the Password field.  GotoKey uses indexed fields only.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Delphiboy
ID: 6153274
Am sorry what do you mean, am not that good in Delphi
0
 
LVL 1

Expert Comment

by:martin_g
ID: 6155058
I mean that you need to crate an index on the "Password" field to use SetKey.  You can create one by: Closing Delphi and then opening the table in Database Desktop (DBD.exe) File|Open|Table. With the table open, go to Table|Restructure.  Click on the Define button under Indexes.  Double click on the Password field to create an index. Check 'Maintained'. Click OK and then give it a name such as 'idxPassword'. You should now see the new index added to the Indexes list.  Close DBD.
You should be able to compile the program okay.  

0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 9285827
Delphiboy,
No comment has been added lately (822 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to martin_g http:#6155058

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

DragonSlayer
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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