Forum Moderators: coopster & phranque

Message Too Old, No Replies

Frontpage *shudder* and SQL

Anyway to decipher SQL statements in FP?

         

knighty

4:56 pm on Nov 26, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have access to ASP and that is what I would like to use.

However

I have been given a load of ASP files that query a database only all the querying is done with FP's 'webot' stuff.

Is there some way of converting or deciphering this stuff...Im on a mac so i dont have front page to view the SQL statements

cyril kearney

7:03 pm on Nov 26, 2001 (gmt 0)

10+ Year Member



Using ASP with a database if fairly straight forward.

Example:
<%
Dim objConn, objRS, strSQL, strDSN

' a string to hold the dataset name, user id and password
strDSN="DSN=xxx;uid=yyy;pwd=zzz"

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strDSN

strSQL ="SELECT count(*) FROM summarytbl"

Set objRS = objConn.Execute(strSQL)

If NOT objRS.EOF
Response.Write objRS(0) & "<br>"

objRS = Nothing
objConn.Close
objConn = Nothing
%>

knighty

9:45 am on Nov 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh right...Now I understand! ....(NOT)

Thnx but I'm new to ASP and was actually hoping for a way to turn Frontpage SQL stuff into ASP SQL stuff.

Woz

9:52 am on Nov 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



knighty,

I am not sure there is an easy way to convert from the webbot stuff to ASP. I have never used the internal FP SQL, preferring to handcode via ASP, although with my level of expertise this can take a long long time.

Unfortunately, I think you might have to convert by hand.

Onya
Woz

knighty

10:02 am on Nov 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



thnx Woz.. thats what I feared :(

Im trying to re-design some pages that were done in frontpage and the page is over 150K and I'm sure most of it is due to the bloated webot code.

Here is just a very small snippet of the code:

<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside
tag="BODY"
local_preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="center"><font color="#000000">End of Database Results region.</font></td></tr></table>"
preview="<table border=0 width="100%"><tr><td bgcolor="#FFFF00" align="left"><font color="#000000">This is the end of a Database Results region.</font></td></tr></table>" --><!--#include file="_fpclass/fpdbrgn2.inc"-->

Stuff like the above is repeated countless times throughout the page and I was hoping to rewrite is using ASP. I dont have access to frontpage so its just a bit of knightymare to edit.

Woz

10:07 am on Nov 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ouch! Bloat is right. I have never really loked at the internal FP databse code before.

You're right. That will all be sent down to the browser. Whereas, although ASP routines can get lengthy, it is only the html result that is sent to the browser after processing.

How many pages?

Onya
Woz

knighty

10:13 am on Nov 30, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well there is just one main page (150k) and some other smaller pages (5-6)

The pages use some ASP but the guy that built the Queries just used Frontpage as he did'nt know how with ASP.

That snippet of code is really small compared to the other stuff, of course if you try to modify the webot stuff Frontpage throws a fit and mauls the code even more.

cyril kearney

3:49 am on Dec 1, 2001 (gmt 0)

10+ Year Member



knighty said: "Oh right...Now I understand! ....(NOT)"

Well in order to use SQL with ASP, you must first know SQL. ASP is built using objects. To use the database object, you must first connect to it, open it and then get the object to execute the SQL code.

In my example, I tried to show that you can just pass the SQL code in a string and ask ASP to execute that code on the database.

The code that you posted later contains no SQL code. It seems to be formatting a table. There is no quick solution, to write ASP pages against a database you need to understand HTML, SQL and ASP.

In the US Barnes and Nobles have lots a good books aimed at the novice which could get you started.

knighty

9:20 am on Dec 3, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Cyril said : "The code that you posted later contains no SQL code."

Exctly my point! I know HTML by hand and have also run SQL statements using access but know nothing about ASP.

My problem is'nt with any of that. My problem is that FP has a wizard for connecting to a database and running SQL only it wraps it all up in <webot> tags.

The code that I pasted was the shortest piece of code i could find - it marks the end of a databse querie and am well aware that it doesnt contain a lot of SQL statements.

<!--webbot bot="DatabaseRegionEnd" startspan b-tableformat="FALSE"
b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="0"

The thing I'm struggling with is trying to figure out what the <webot> stuff is doing. i.e whats "u-dbrgn2="_fpclass/fpdbrgn2.inc"

I can't really just delete <webot> stuff as the pages will not work. (its run with a server using Front Page Extensions.

Woz

9:34 am on Dec 3, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would run the web to figure out WHAT each page is doing rather than HOW it is doing it. ie., if a page returns a list of company products from X department, it should be possible then to write the ASP/SQL code to give the same results. A lot like deciphering SERPs maybe.

Onya
Woz

txbakers

6:52 pm on Dec 3, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you download a copy of Dreamweaver Ultradev, free from macromedia, you will get a good basic understanding of ASP coding.

I used it to learn the syntax and object structure, then you can take off from there.

But it sure beats trying to learn it from scratch.

And Dreamweaver doesn't use proprietary tags in your code.

knighty

10:17 am on Dec 4, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



txakers,

I was actually thinking about getting Ultradev as I already use Dreamweaver.

Does it have a full versions of Dreamweaver or is it a watered down version?

TheLynxEffect

2:25 am on Dec 12, 2001 (gmt 0)



The version you can download from Macromedia is a fully working version. However!.... it only works for 30 days, and it does cost a fair amount to purchase it!

Sticky