Alpha Video Training
Results 1 to 17 of 17

Thread: Log-In Help

  1. #1
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Log-In Help

    I have most likely a syntax issue I need some help with. I am
    working on a log in form and have followed the instructions in help as well as
    the forum.

    The error I receive is:

    Errors in: event.Form Level Validate code:
    error: lookup(c:\data\contacts - customers,Email="EMAIL ADDRESS.com",
    password) The system cannot find the file specified.
    c:\data\contacts - customers.DBF

    I do have the contacts - customers.dbf in my Data folder. I am using an email as the username.

    My Validate code is:

    if (User_Name = "") .or. (Password = "") then

    currentform.has_error = .t.

    currentform.error_message = "User name or password is blank."

    else

    dim correct_password as C

    correct_password = lookup("c:\data\contacts - customers", "Email="+quote
    (User_Name), "password")

    if (correct_password <> password) then

    currentform.has_error = .t.

    currentform.error_message = "Invalid user name or password."

    end if

    end if


    As always any assistance is greatly appreciated.

    Ken

  2. #2
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Follow up

    My other form does point to the same DBF file and I can add a record via a form on line.

    My log in dialog is not finding that file and I have tried every variation in the lookup() that I can think of and I get the same message.

    I'm sure this is an easy thing to do and it is probably an easy fix but I'm darned if I can find it.

    Again, any help would be greatlyl appreciated.

  3. #3
    Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,592

    Default

    I'm a bit unclear as to what your lookupc() expression really looks like. Make sure you haven't hard-coded the path. And make sure you use the path alias. Here's an example:

    Code:
    lookupc("f", key, "Market", "[PathAlias.ADB_Path]\Avail_citystate","State_City")
    -Steve


  4. #4
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default

    Ken,

    Are you publishing to localhost or to a server? If so, does it work if you run on localhost, but not on the server? Remember, the path to the data table has to be relative to the Alpha Web Server. If that's a server, then you'd have to have the c:\data directory on THAT server for it to work.

    Your lookup syntax is correct, except you should do as Steve said and make it lookup("[PathAlias.ADB_Path]\contacts - customers"...)

    And make sure this is in your Profile for the Alias:

    [PathAlias.ADB_Path] = =a5.get_path()

    One last thing, nothing to do with your question, and you don't have to follow - but you should get in the habit of naming your tables properly. Keep them short, and no embedded spaces or dashes. Your's has a split personality and can't decide if it holds contacts or customers. I assume both, but the terms are overlapping. You should pick one that is broad enough to cover its contents, but narrow enough to be obvious. The name should probably be either Contact or Customer (not plural). There are other reasons to keep it short when you start writing code to manipulate your components in the A5W page.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  5. #5
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Have you had any success?

    Have you had any success - I mean have you used the standard process yet, as per alpha sports samples and made it work?

  6. #6
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Here's what happens....

    I am working off the Alpha Five server. I made the following changes to my validate code as suggested:

    correct_password = lookup("[PathAlias.ADB_Path]\Contacts - Customers", "Email="+quote(User_Name), "password")I have 2 Aliases; one identical to what you suggested and another one:

    [PathAlias.ADB_Path] = c:\data\_MYSERSVER_

    Here is what I get when I try it on line:


    Errors in: event.Form Level Validate code:
    error: lookup([PathAlias.ADB_Path]\Contacts - Customers,Email="Ken@Parksleepfly.Com",password) The system cannot find the path specified.
    \[PathAlias.ADB_Path]\Contacts - Customers.DBF



    Also- you have me dead to right on the naming of my tables. Though I am far from a programmer I do know better. I started dabbling and got too far in to change the name. Consider my wrist slapped- I deserved it.

    I appreciate the assistance.

    Ken

  7. #7
    Moderator Steve Workings's Avatar
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,592

    Default

    Make sure you're using lookupc(), not lookup()

    You might also try this on another table with a name that meets naming standards. If you can get the lookupc() to work with the other table, then that confirms that your path alias is correct, and brings up the possibility that you'll need to reconsider your current table name.
    -Steve


  8. #8
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default

    Ken, I'm going to assume you have two PROFILES, each with ONE alias named [PathAlias.ADB_Path]. You can't have two alias' with the same name for the same profile.

    Let's take a step back or we will be taking stabs in the dark. Tell us the following:

    • Where is Alpha Five full developer version installed, on the server or on a client computer connected to the server?
    • Where is your Alpha project database installed, on the server or on a client computer connected to the server?
    • When you open your project, what is the path to your Alpha project database?


    Steve is correct on the lookupc() and table name, but they are not required changes at this testing stage. I physically recreated your long table name and tested that it works fine, even with the embedded blanks and name length. Lookupc() is more effecient, but it would require you to take some extra steps that, right now, do not help your testing.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  9. #9
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Answers I Hope

    This is a project for myself. I have Alpha Five installed here. The project dbase is installed here and I have it uploaded on line. For the third question- I'm not sure how to answer this.

    I did change the log in to Lookupc() and I got farther, but it said:

    Errors in: event.Form Level Validate code:
    Too few parameters.


    How do I determine which Alias to delete or edit?

    Thanks for your attention. I feel we're close. Once squared away will this make it so a person logging in see only their stuff?

    Ken

    Quote Originally Posted by Steve Wood
    Ken, I'm going to assume you have two PROFILES, each with ONE alias named [PathAlias.ADB_Path]. You can't have two alias' with the same name for the same profile.

    Let's take a step back or we will be taking stabs in the dark. Tell us the following:

    • Where is Alpha Five full developer version installed, on the server or on a client computer connected to the server?
    • Where is your Alpha project database installed, on the server or on a client computer connected to the server?
    • When you open your project, what is the path to your Alpha project database?


    Steve is correct on the lookupc() and table name, but they are not required changes at this testing stage. I physically recreated your long table name and tested that it works fine, even with the embedded blanks and name length. Lookupc() is more effecient, but it would require you to take some extra steps that, right now, do not help your testing.

  10. #10
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default

    Ken.

    "Here" is not a suitable answer. I can't help you at this point.

    No, completing this login phase will not make it so users only see their items. Its just the first step. You are going to have to step back and read the user guide on this subject. You need to understand filtering the grid using override code in the A5W page, protected variables, session variables.

    I suggested you not attempt to replace lookup() with lookupc() at this time, it only complicated your task.
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  11. #11
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default How to make suitable.

    How can I make my answer more suitable?

    Dang, I kind of assumed there were more steps. I will definitely do the leg work to attempt this- until I hit a wall.

  12. #12
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default

    Sorry, did not mean to be so abrupt. I guess my question "Where" is just as non-specific as "here".

    Let's try a different path, one at at time.

    When you publish your web project, does the Publish dialog say, under Select Profile "Local Webroot"? Or something different?
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  13. #13
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Path

    No offense taken.

    I can choose Local Webroot or my Server- which is what I would pick. I also use WS-FTP to upload files.

    Quote Originally Posted by Steve Wood
    Sorry, did not mean to be so abrupt. I guess my question "Where" is just as non-specific as "here".

    Let's try a different path, one at at time.

    When you publish your web project, does the Publish dialog say, under Select Profile "Local Webroot"? Or something different?

  14. #14
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Update to my issue

    I decided to rename the table (contacts - customers.dbf) to a members.dbf. My sign up form still works on line and plops a new record when it is filled and sent.

    I am still having path issues though as I keep getting;

    Error 3 - The system cannot find the path specified. \[PathAlias.ADB_Path]\Reviews.dbf

    Steve has told me I can't have 2 Pathalias.ADBs but I don't know how to rectify this. Currently I have;

    LocalRoot= [PathAlias.ADB_Path] = =a5.get_path()
    AND
    NAME= [PathAlias.ADB_Path] = c:\data\_MYSERVER_


    For a brief time it was finding the table but now it isn't (problem is I don't know why it worked all of a sudden).

    I feel this is probably easy to fix but I keep going in circles. Any halp would be greatly appreciated.

    Thanks in advance

    Ken

  15. #15
    Moderator Steve Wood's Avatar
    Real Name
    Steve Wood
    Join Date
    Nov 2003
    Location
    Bay Area, California
    Posts
    8,827

    Default

    I said you could not have two assignments to the same variable in the same profile. Obviously you could/would have one per profile, each with a potentially different assignment.

    If you contact me via email, I will offer to 'dial in' to your computer and take a look. Maybe we can fix this!
    Steve Wood
    Join the ALPHA DEVELOPERS NETWORK
    There is no Cloud. It's just someone else's computer.
    Web - Mobile - Hosting - Products - Frameworks - Developer Resources
    AlphaToGo | IADN (100% Alpha Anywhere Websites)

  16. #16
    Member
    Real Name
    Ken Boucher
    Join Date
    Feb 2006
    Location
    Manchester, CT
    Posts
    200

    Default Perseverance Pays Off

    Thanks Steve for the offer and your time. I was able to solve the issue last night. Maybe it's in the "No Duh" category, but I was uploading my databases with an FTP software, not Alpha Five. Once I used Alpha Five's internal publisher all became right in the world.

    I knew it was something simple. Being the Einstein that I am I uncovered the 'simple' problem in only 8 days..... :-)

    Ken

  17. #17
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,537

    Default Post have asked this very question.

    Anyhow, well done. Good developing..
    Peter

Similar Threads

  1. Phone Message Log
    By Jimmie1234 in forum Alpha Five Version 7
    Replies: 1
    Last Post: 01-02-2006, 01:29 PM
  2. Log on to my server
    By bsteward in forum Web Application Server v6
    Replies: 17
    Last Post: 10-25-2005, 08:16 PM
  3. Log out of APP
    By Steve Bovino in forum Web Application Server v6
    Replies: 15
    Last Post: 03-07-2005, 05:54 AM
  4. Log Off
    By Louis Nickerson in forum Web Application Server v6
    Replies: 7
    Last Post: 02-24-2005, 01:49 PM
  5. Raw Response Log
    By Gregory R. Zilliox in forum Web Application Server v6
    Replies: 2
    Last Post: 12-22-2004, 02:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •