Troubles with database searching

M

Mr. Know Nothing

I am using FP 2002 and win server 2003 enterprise edition. I have a database
of addresses that i want to be able to search throught via my site. I have
made the query: "Select * from Dealers" this works but then when i use the
query: "Select * from Dealers WHERE province = ::T1::" i get an error (error
can be seen at www.ujr.ca/test/canadadealers.asp)

The steps from when it's working to when it is not are as follows:
1) change the query
2) at the last step in the database results wizard made sure that the "Add
search form" is checked
3) click finish, and then save and publish

Values that should work are: NS, Nova Scotia, Ontario
I have tried to have one of these values as default value and still get the
same error.

If anyone can help me with this it would be greatly appreciated.
 
M

Mr. Know Nothing

I have stumbled apon the answer to my problem. When entering the value in the
form I must include the single quotes. This is a suprise to me as I did not
need them on when I was running the site on my XP machine.

Thanks anyways.
 
P

p c

What is the "::" ? I is part of FP's way of handling queries. (I don't
use FP for database acess. I write my own code in ASP.)

The SQL variable in ASP would be
"Select * from Dealers WHERE province = '" & T1 & "'"

Which would reult in
"Select * from Dealers WHERE province = 'Nova Scotia'
for the database, for T1="Nova Scotia"

In SQL statments, text must be delimited by single quotes. If the text
contains quotes, you double it for the engine to undertand you mean the
quote as part of the text. E.g.
WHERE province = 'John''s Place'

...PC
 
M

Mr. Know Nothing

Yes the "::" are part of FP. Thanks for showing me how you do it. That might
come in handy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top