Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does FP alter my script?

Status
Not open for further replies.

dwalker

Technical User
Nov 29, 2002
34
0
0
Howdy

I've made a database query result using FP's Database Results Wizard and would like to change the SQL FP automatically inserts.

The wizard has created:

fp_sQry="SELECT * FROM tblUserNames"

and I'd like to change this to:

fp_sQry="SELECT * FROM tblUserNames WHERE user_id = " & Request.QueryString("userid")

If I make this change within the Wizard FP tells me it creates a syntax error. So I tried making the change in the HTML window but FP says "The contents of a FrontPage component have been modified. These contents will be overwitten when you save this page" and then removes the changes I made.

Can anybody help with how to make the alteration I'm after? By the way, I've been able to work around for now by changing the HTML from within Notepad but I'd like a better solution!

Regards

Damien
 
I would be very tempted to say dont use frontpage :p!
But seeing as you are acclimatised to it, try this.
Copy the code you currently have (the select query) then when you want this in another page paste it in manually and edit it manually instead of using a wizard

Hope this helps,

The way web design should be
 
Thanks, noellees1 but as I mention above, FrontPage alters the code when I make changes directly in the HTML editor - i.e. without using a wizard.

Any ideas?
 
Are you sure the syntax of 'fp_sQry=' is correct?
Is '&' a substitute for '+'?
I may be off the track but the line just looks wrong in some way.
Keith
 
As far as I know, FP wil keep changing it. You could open that page up in Notepad, change it, and the publish it - that should work. But with this part - FP thinks that it knows what it is doing & does not want you messing with its code.

__________________________
Corey

 
If you make the change in the code in the gray web bot text (in HTML view) and not in the red ASP code that FP generates, then FP will regenerate the red ASP part of the HTML code in HTML view when you save the page.

Anytime you change the code from a DRW, unless you make the change in the gray part of the code or the "commented out" part of the code, FP will change it back to the original.

Let us know if that helps and if you have any more problems.

Tiffany

Microsoft MVP - FrontPage
 
Is the page you are editing an .html page? If not I wouldn't use FrontPage to edit it. You should keep using NotePage or use UltraEdit.

When you edit a page using NotePad or UltraEdit you will have to click back into FP (anywhere) to actually save your changes to the web server. Jut a tip.

FrontPage should not be used to edit .asp or .php pages. It will jack them up every time.
 
I have never had any luck editing ASP or PhP pages with FP. It always breaks the pages. FP is an html editor and should only be used to edit html. That is my opinion. Even if FP generates the ASP. FP has to many issues when it comes to code. I like to use FP for a lot of things but editing code other then HTML is not one of them.
 
CoreyBryant said:
Frontpage (esp 2003) is OK to edit ASP or PHP pages, but what the user seems to be edtting is FP generated ASP coding. And FP will go back & "fix" it
The exact reason why i learnt the 'hard way' coding in cfm using notepad or dreamweaver (which is infinitely better than frontpage)
Anyway just thought i would air my views that FP is very weak as an editor, i heard it adds depreciated tags all over the place.


Hope this helps,

The way web design should be
 
Well I know FP 2000 was very bad with ASP, but 2002 was a lot better & now 2003 will even do .NET without messing up the coding.

DW is the same - it adds bloated coding as well. I have not had the chance yet to install the newest DW but it should be better. I have been very pleased with FP 2003 updates.

__________________________
Corey

 
Agreed on FP 2000 and altering code, especially ASP code. I never had a lot of problem with 2002, but FP 2003 is really good about not messing up my code. I haven't heard of anyone having any problems with FP 2003 messing with their ASP code.

Tiffany

Microsoft MVP - FrontPage
 
*SHOCK* DW uses a depreciated code centre the centre tag i seem to remember was being depreciated?
Anyway i respect your opinions on FP getting better (it sure needed to) but personally for real big webdev i use DW because it seems more specialist.
I feel that FP was made to integrate into the office suite and stay there as a simple web development program.
I find DWS coding 'hints' and 'snippets' useful but i prefer to not have the program touch my code unless i give it the say so (the topic of this convo)



Hope this helps,

The way web design should be
 
Getting back to the original question.
What does the line:-
fp_sQry="SELECT * FROM tblUserNames WHERE user_id = " & Request.QueryString("userid")
change to after FP has done it's altering?
Keith
 
Okay, so we're back to the topic at last....

Thank you all for your opinions about the relative merits of various editors, but frankly, if I was interested in your [red]opinions[/red] I'd read your blogs. Only [blue]audiopro[/blue] and [blue]naconi[/blue] seem interested in finding an answer to my question, the rest of you should try harder to maintain the value of these forums by starting another thread when you want to comment on something other than the original post.

Like it or not, I [red]AM[/red] using FrontPage and need a solution that solves my problem without buying DreamWeaver!

[blue]naconi[/blue], your suggestion above shows you understand the issue. However, it hasn't quite worked. The original code in the grey web bot text was:

Code:
s-sql="SELECT * FROM tblUserNames" b-procedure="FALSE" clientside

I then insert my change to give:

Code:
s-sql="SELECT * FROM tblUserNames WHERE user_id = " & Request.QueryString("user_id") b-procedure="FALSE" clientside

As you suggest, FP then changes the red ASP code, but it doesn't quite go far enough, changing from...

Code:
fp_sQry="SELECT * FROM tblUserNames"

to...

Code:
fp_sQry="SELECT * FROM tblUserNames WHERE user_id = "

When run, this produces a syntax error - as is obvious from reading the SQL.

If I attempt to change the ASP script directly this results in FP simply changing it back to its original content (to answer [blue]audiopro's[/blue] question).

If FP is unable to deal with such "interfering" then I'll have to live with that but can't help but wonder if there's a way around it's stubborness.

Regards

Damien
 
Hi Damien
Sorry I can't call on too much experience with Queries in FrontPage but I do a lot with Microsoft Foxpro.
It seems that FrontPage sees the end of the query at the first closing speech mark and treats the rest of it as a typo. Have you tried enclosing the whole query in speech marks and enclosing the vars with '.
eg.

s-sql="SELECT * FROM tblUserNames WHERE user_id = " & Request.QueryString('user_id') b-procedure='FALSE' clientside"

Sorry but not sure how to quote bits of code correctly.
Keith
 
Preferably removing the " after the = sign too - oops!
Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top