navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Getting query syntax correct

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Getting query syntax correct
Page: [1]
 
rikki

 

Posts: 382
Joined: 4/4/2004
Status: offline

 
Getting query syntax correct - 3/13/2008 12:36:00   
I've set up a database result in frontpage, dieted it..
Can't get it work the way I would like..
If I enter the number and password- works.
If I enter the Lastname and password - doesn't work (but it should. Any ideas..
fp_sQry="SELECT * FROM BRYSON3A WHERE ((BOOKINGNUMBER =  ::BOOKINGNUMBER:: OR LASTNAME =  '::LASTNAME::') AND (PASSWORD =  '::PASSWORD::'))"
ou812

 

Posts: 1539
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: Getting query syntax correct - 3/13/2008 14:06:39   
Hmm, it looks okay. Maybe double check your form name and database name for "lastname" and make sure they're what you have?

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to rikki)
rdouglass

 

Posts: 9167
From: Biddeford, ME USA
Status: offline

 
RE: Getting query syntax correct - 3/13/2008 14:21:27   
quote:

fp_sQry="SELECT * FROM BRYSON3A WHERE ((BOOKINGNUMBER = ::BOOKINGNUMBER:: OR LASTNAME = '::LASTNAME::') AND (PASSWORD = '::PASSWORD::'))"


I suspect grouping. Try it this way:

fp_sQry="SELECT * FROM BRYSON3A WHERE ((BOOKINGNUMBER = ::BOOKINGNUMBER::) OR (LASTNAME = '::LASTNAME::')) AND (PASSWORD = '::PASSWORD::')"

See the diff? That help any?

EDIT: Either that or there's a space in there. Try a trim statement.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to ou812)
rikki

 

Posts: 382
Joined: 4/4/2004
Status: offline

 
RE: Getting query syntax correct - 3/13/2008 16:04:07   
I tried that new query; checked spaces..
Same thing..
Error when I use Lastname and password:
Database Results Error
Description: Extra ) in query expression '((BOOKINGNUMBER = ) OR (LASTNAME = 'tucker')) AND (PASSWORD = 'tucker1')'.
Number: -2147217900 (0x80040E14)
Source: Microsoft JET Database Engine

One or more form fields were empty. You should provide default values for all form fields that are used in the query.
One or more form fields were empty. You should provide default values for all form fields that are used in the query.

(in reply to rdouglass)
ou812

 

Posts: 1539
Joined: 1/5/2002
From: San Diego
Status: offline

 
RE: Getting query syntax correct - 3/13/2008 16:19:52   
Ah, makes sense now.

The query isn't working since you don't have a booking number. Not sure how the diet stuff works, but are you able to create your query depending on logic? Or can you default booking number to something, since it won't matter because it is an OR?

_____________________________

-brian

EnterpriseDB: Enterprise-class relational database management system
PostgreSQL: The world's most advanced open source database

(in reply to rikki)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Getting query syntax correct
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts