Trouble Accessing FoxPro table

Hi, here is my situation. There is a FoxPro file that is treated as a single table, within a directory f:
tdata. I have created an SQL component sqlGetUsers, given it a database name of f:
tdata, and a table name of SECURITY (corresponding to the file SECURITY.DBF). I need to match against two fields in SECURITY, User_Name and Password. The SQL I create looks like this:

"SELECT * FROM SECURITY WHERE User_Name = 'RUSTY' AND Password = 'RUSTY'"

There error I get back when I open this SQL is "Invalid use of reserved word 'Password' line 1". If I remove the Password portion of the statement, everything works fine.

So apparently, for the FoxPro driver that translates my Delphi created SQL statement, Password is a reserved word that cannot be used as a field. The only problem is, I have no control over the FoxPro tables/files themselves, they are public at the place I work, I can only retrieve information. I guess my question is, is there a different way to describe these fields in Delphi SQL? Is there any way to ask for, say, field 4 within the SQL statement itself?

I have tried this:

"SELECT * FROM SECURITY WHERE SECURITY.User_Name = 'RUSTY' AND SECURITY.Password = 'RUSTY'"

and this does not work. I have also used parameters like so:

"SELECT * FROM SECURITY WHERE User_Name = :UserName AND Password = :Password"
(and then have filled in the parameters before opening the SQL.)

This does not work either. Can anyone help here?

Any advice would be appreciated!

Rusty

Comments


  • : "SELECT * FROM SECURITY WHERE User_Name = 'RUSTY' AND Password = 'RUSTY'"

    : There error I get back when I open this SQL is "Invalid use of reserved word 'Password' line 1".
    try changing SECURITY to VSECURITY then ask again if doesnt work
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion