navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
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

Free FrontPage Templates

Search Forums
 

Advanced search
Recent Posts

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

 

FP Database "Update" question

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

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

All Forums >> Web Development >> Microsoft FrontPage Help >> FP Database "Update" question
Page: [1]
 
marker2001

 

Posts: 5
Joined: 6/28/2007
Status: offline

 
FP Database "Update" question - 12/13/2007 1:07:56   
I've read almost all of what Spooky has written and am grateful.
I've run into a situation that requires some outside help.

I want to update a database using the FP DRW in this manner:
I want to reset all the values in a particular column in the DB on a daily basis. Unfortunately, hte DRW won't accept an asterix as a wildcard and using a double percent gets me an error.

This is what I want it to say -
fp_sQry="UPDATE Gen_Info SET Today = 'out' WHERE (Last_4 = '*')"

If this could also overlook the row/field if it were to start with "vacation" or "TAS" that would be excellent!
And, if it could run automatically at midnight every day, well, it'd be like Christmas. :)

Any suggestions?

William Lee

 

Posts: 1179
Joined: 1/25/2002
From: Singapore
Status: offline

 
RE: FP Database "Update" question - 12/13/2007 1:22:50   

Try use
fp_sQry="Update Gen_Info SET Today='out' WHERE (Last_4 NOT LIKE 'vacation%') OR (Last_4 NOT LIKE 'TAS%')"

You need a task scheduler on your server to run the update script at 12 midnite daily.


_____________________________

William Lee

pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ
nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ





(in reply to marker2001)
marker2001

 

Posts: 5
Joined: 6/28/2007
Status: offline

 
RE: FP Database "Update" question - 12/13/2007 1:50:12   
William -
Thanks! That works.
Well, almost. What I gave you as the query was wrong.

I want to update the field "Today" but I want to not update that field if it contains "vacation" or "TAS".

I changed the syntax to :

fp_sQry="Update Gen_Info SET Today='out' WHERE (Today NOT LIKE 'vacation%') OR (Today NOT LIKE 'TAS%')"

and it updates the DB wonderfully, but does not overlook fields that are "vacation" or "TAS"
for some reason it is ignoring the WHERE parameter - perhaps because it's the same field?

Can the query be re-worded to run the "not like" parameters first b4 it updates the fields?

TIA!
- Mark

(in reply to William Lee)
William Lee

 

Posts: 1179
Joined: 1/25/2002
From: Singapore
Status: offline

 
RE: FP Database "Update" question - 12/13/2007 1:58:17   
Does Today starts with 'vacation' or contains 'vacation'?

Try
fp_sQry=="Update Gen_Info SET Today='out' WHERE (Today NOT LIKE '%vacation%') OR (Today NOT LIKE '%TAS%')"


_____________________________

William Lee

pǝssǝɟoɹd-ɟ1ǝs ʎɥʇɹoʍʇsnɹʇ ʇsoɯ ɹnoʎ
nɹnb ǝsɐqɐʇɐp & dsɐ ,ʍɹp ,ǝbɐdʇuoɹɟ





(in reply to marker2001)
marker2001

 

Posts: 5
Joined: 6/28/2007
Status: offline

 
RE: FP Database "Update" question - 12/13/2007 12:51:13   
Thanks, but no. It doesn't like both parameters. It will process fine with only one tho.

I even tried it like this:

fp_sQry="Update Gen_Info SET Today='out' WHERE (Today NOT LIKE '%vacation%' OR Today NOT LIKE '%TAS%')"

But it's no good.

Since I can use the asterix in the code I've just changed it to say:

fp_sQry="Update Gen_Info SET Today='out' WHERE (Today NOT LIKE '% *%')"

and then I just put a "*" in all the fields I don't want erased.

I read somewhere that different fields (text box, text area, radio button, etc.) require different code for the FP DRW but I forgot where I saw that . Perhaps the text area I am using does not support the "OR" statement?

Thanks!

(in reply to William Lee)
rdouglass

 

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

 
RE: FP Database "Update" question - 12/13/2007 13:17:23   
quote:

(Today NOT LIKE '%vacation%' OR Today NOT LIKE '%TAS%')"


It's all in the logic:

(Today NOT LIKE 'vacation%') AND (Today NOT LIKE 'TAS%')"

see it? That should exclude all of the Today fields that start with either 'vacation' or 'TAS'. Remeber you're dealing with negatives:

If (not A) AND (not B) Then...

</$.02>

_____________________________

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

ASP Checkbox Function Tutorial.

(in reply to marker2001)
marker2001

 

Posts: 5
Joined: 6/28/2007
Status: offline

 
RE: FP Database "Update" question - 12/13/2007 18:34:03   
EXCELLENT!! :)
Thanks guys!!


(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> Microsoft FrontPage Help >> FP Database "Update" question
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