PC Review


Reply
Thread Tools Rate Thread

Correct syntax for SELECT with asp field?

 
 
Jackie
Guest
Posts: n/a
 
      5th Nov 2003
I'm stuck on the correct syntax for an access database select statement, if
what I'm trying to do is even possible within a DRW! Can anyone advise,
please?

I'm writing the contents of a form to a database. On the Confirmation page I
need to use the value of one of the fields (numeric) to look up a record on
another table within the same database, so that full details can be
displayed.

I know that I can't actually use the confirmation field itself, but was
hoping to be able to use <% =FP_SavedFields("bookerid") %> in the SQL
statement. I've written it to the confirmation page and know it contains the
value I need.

My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
=FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated string
constant' error with this.

I've tried all sorts of combinations over the last few hours but I'm not
having any luck and would appreciate some help )

Many thanks,
Jackie

(XP Pro and FP2002 with server extensions)





 
Reply With Quote
 
 
 
 
Thomas A. Rowe
Guest
Posts: n/a
 
      5th Nov 2003
Try

Bookerid = FP_SavedFields("bookerid")

fp_sQry="SELECT * FROM bookers where id = " & Bookerid

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

"Jackie" <(E-Mail Removed)> wrote in message
news:bobee7$flj$(E-Mail Removed)...
> I'm stuck on the correct syntax for an access database select statement,

if
> what I'm trying to do is even possible within a DRW! Can anyone advise,
> please?
>
> I'm writing the contents of a form to a database. On the Confirmation page

I
> need to use the value of one of the fields (numeric) to look up a record

on
> another table within the same database, so that full details can be
> displayed.
>
> I know that I can't actually use the confirmation field itself, but was
> hoping to be able to use <% =FP_SavedFields("bookerid") %> in the SQL
> statement. I've written it to the confirmation page and know it contains

the
> value I need.
>
> My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
> =FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated string
> constant' error with this.
>
> I've tried all sorts of combinations over the last few hours but I'm not
> having any luck and would appreciate some help )
>
> Many thanks,
> Jackie
>
> (XP Pro and FP2002 with server extensions)
>
>
>
>
>



 
Reply With Quote
 
Jackie
Guest
Posts: n/a
 
      5th Nov 2003
Thomas -

thanks for the reply. I've had a few attempts at this, but with no success
so far.

Nearly everything gets thrown out as invalid syntax when I try to do it
within the FrontPage database results custom query, except for
fp_sQry="SELECT * FROM bookers WHERE bookerid = "" &Bookerid""" which
results in error : Too few parameters. Expected 2. (I didn't type all those
quotes in, most were generated).

I've gone into HTML view, but I can't change the fp_sQry ..... line as
FrontPage changes it back when I try to save.

I've tried to make the changes to the s-sql= ..... line in the webbot
section above, but whatever I type in there comes out differently in the
fp_sQry statement when it's saved.

For example :-

s-sql="SELECT * FROM bookers WHERE bookerid = "&Bookerid
results in
fp_sQry="SELECT * FROM bookers WHERE bookerid = "
which chops off the end of the statement.


s-sql="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
results in
fp_sQry="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
which gives Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'.

I've tried various combinations of single and double quotes but all result
in 'invalid SQL statement' or 'too few parameter' errors.

Have you any idea how I can format the s-sql statement so that it comes out
correctly when it's saved to the fp_sQry line?

Thanks,
Jackie










"Thomas A. Rowe" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Try
>
> Bookerid = FP_SavedFields("bookerid")
>
> fp_sQry="SELECT * FROM bookers where id = " & Bookerid
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, Forums, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "Jackie" <(E-Mail Removed)> wrote in message
> news:bobee7$flj$(E-Mail Removed)...
> > I'm stuck on the correct syntax for an access database select statement,

> if
> > what I'm trying to do is even possible within a DRW! Can anyone advise,
> > please?
> >
> > I'm writing the contents of a form to a database. On the Confirmation

page
> I
> > need to use the value of one of the fields (numeric) to look up a record

> on
> > another table within the same database, so that full details can be
> > displayed.
> >
> > I know that I can't actually use the confirmation field itself, but was
> > hoping to be able to use <% =FP_SavedFields("bookerid") %> in the SQL
> > statement. I've written it to the confirmation page and know it contains

> the
> > value I need.
> >
> > My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
> > =FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated string
> > constant' error with this.
> >
> > I've tried all sorts of combinations over the last few hours but I'm not
> > having any luck and would appreciate some help )
> >
> > Many thanks,
> > Jackie
> >
> > (XP Pro and FP2002 with server extensions)
> >
> >
> >
> >
> >

>
>



 
Reply With Quote
 
Thomas A. Rowe
Guest
Posts: n/a
 
      5th Nov 2003
Personally, I avoid using the FP database component and hand code my ASP,
anyway...

Is the bookerid a number or text field in the database?

If it is a text field, try:

fp_sQry="SELECT * FROM bookers WHERE bookerid = '" & Bookerid & "' "

Otherwise, unless someone else can help, it is time to learn to hand code
which will give you a lot more flexibility in the long run, plus you will
have learn ASP.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

"Jackie" <(E-Mail Removed)> wrote in message
news:bobqlr$pse$(E-Mail Removed)...
> Thomas -
>
> thanks for the reply. I've had a few attempts at this, but with no success
> so far.
>
> Nearly everything gets thrown out as invalid syntax when I try to do it
> within the FrontPage database results custom query, except for
> fp_sQry="SELECT * FROM bookers WHERE bookerid = "" &Bookerid""" which
> results in error : Too few parameters. Expected 2. (I didn't type all

those
> quotes in, most were generated).
>
> I've gone into HTML view, but I can't change the fp_sQry ..... line as
> FrontPage changes it back when I try to save.
>
> I've tried to make the changes to the s-sql= ..... line in the webbot
> section above, but whatever I type in there comes out differently in the
> fp_sQry statement when it's saved.
>
> For example :-
>
> s-sql="SELECT * FROM bookers WHERE bookerid = "&Bookerid
> results in
> fp_sQry="SELECT * FROM bookers WHERE bookerid = "
> which chops off the end of the statement.
>
>
> s-sql="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> results in
> fp_sQry="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> which gives Invalid SQL statement; expected 'DELETE', 'INSERT',

'PROCEDURE',
> 'SELECT', or 'UPDATE'.
>
> I've tried various combinations of single and double quotes but all result
> in 'invalid SQL statement' or 'too few parameter' errors.
>
> Have you any idea how I can format the s-sql statement so that it comes

out
> correctly when it's saved to the fp_sQry line?
>
> Thanks,
> Jackie
>
>
>
>
>
>
>
>
>
>
> "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> news:#(E-Mail Removed)...
> > Try
> >
> > Bookerid = FP_SavedFields("bookerid")
> >
> > fp_sQry="SELECT * FROM bookers where id = " & Bookerid
> >
> > --
> >
> > ==============================================
> > Thomas A. Rowe (Microsoft MVP - FrontPage)
> > WEBMASTER Resources(tm)
> > http://www.ycoln-resources.com
> > FrontPage Resources, Forums, WebCircle,
> > MS KB Quick Links, etc.
> > ==============================================
> > To assist you in getting the best answers for FrontPage support see:
> > http://www.net-sites.com/sitebuilder/newsgroups.asp
> >
> > "Jackie" <(E-Mail Removed)> wrote in message
> > news:bobee7$flj$(E-Mail Removed)...
> > > I'm stuck on the correct syntax for an access database select

statement,
> > if
> > > what I'm trying to do is even possible within a DRW! Can anyone

advise,
> > > please?
> > >
> > > I'm writing the contents of a form to a database. On the Confirmation

> page
> > I
> > > need to use the value of one of the fields (numeric) to look up a

record
> > on
> > > another table within the same database, so that full details can be
> > > displayed.
> > >
> > > I know that I can't actually use the confirmation field itself, but

was
> > > hoping to be able to use <% =FP_SavedFields("bookerid") %> in the SQL
> > > statement. I've written it to the confirmation page and know it

contains
> > the
> > > value I need.
> > >
> > > My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
> > > =FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated string
> > > constant' error with this.
> > >
> > > I've tried all sorts of combinations over the last few hours but I'm

not
> > > having any luck and would appreciate some help )
> > >
> > > Many thanks,
> > > Jackie
> > >
> > > (XP Pro and FP2002 with server extensions)
> > >
> > >
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Jackie
Guest
Posts: n/a
 
      5th Nov 2003
Thomas -

Bookerid is a numeric field, it's the primary key, an auto-generated number.

I'll give it a few more tries, then if no-one else can help I guess I'll
have to bite the bullet and hit the books!

Thanks for your help,
Jackie


"Thomas A. Rowe" <(E-Mail Removed)> wrote in message
news:uPxiMg#(E-Mail Removed)...
> Personally, I avoid using the FP database component and hand code my ASP,
> anyway...
>
> Is the bookerid a number or text field in the database?
>
> If it is a text field, try:
>
> fp_sQry="SELECT * FROM bookers WHERE bookerid = '" & Bookerid & "' "
>
> Otherwise, unless someone else can help, it is time to learn to hand code
> which will give you a lot more flexibility in the long run, plus you will
> have learn ASP.
>
> --
>
> ==============================================
> Thomas A. Rowe (Microsoft MVP - FrontPage)
> WEBMASTER Resources(tm)
> http://www.ycoln-resources.com
> FrontPage Resources, Forums, WebCircle,
> MS KB Quick Links, etc.
> ==============================================
> To assist you in getting the best answers for FrontPage support see:
> http://www.net-sites.com/sitebuilder/newsgroups.asp
>
> "Jackie" <(E-Mail Removed)> wrote in message
> news:bobqlr$pse$(E-Mail Removed)...
> > Thomas -
> >
> > thanks for the reply. I've had a few attempts at this, but with no

success
> > so far.
> >
> > Nearly everything gets thrown out as invalid syntax when I try to do it
> > within the FrontPage database results custom query, except for
> > fp_sQry="SELECT * FROM bookers WHERE bookerid = "" &Bookerid""" which
> > results in error : Too few parameters. Expected 2. (I didn't type all

> those
> > quotes in, most were generated).
> >
> > I've gone into HTML view, but I can't change the fp_sQry ..... line as
> > FrontPage changes it back when I try to save.
> >
> > I've tried to make the changes to the s-sql= ..... line in the webbot
> > section above, but whatever I type in there comes out differently in the
> > fp_sQry statement when it's saved.
> >
> > For example :-
> >
> > s-sql="SELECT * FROM bookers WHERE bookerid = "&Bookerid
> > results in
> > fp_sQry="SELECT * FROM bookers WHERE bookerid = "
> > which chops off the end of the statement.
> >
> >
> > s-sql="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> > results in
> > fp_sQry="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> > which gives Invalid SQL statement; expected 'DELETE', 'INSERT',

> 'PROCEDURE',
> > 'SELECT', or 'UPDATE'.
> >
> > I've tried various combinations of single and double quotes but all

result
> > in 'invalid SQL statement' or 'too few parameter' errors.
> >
> > Have you any idea how I can format the s-sql statement so that it comes

> out
> > correctly when it's saved to the fp_sQry line?
> >
> > Thanks,
> > Jackie
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> > news:#(E-Mail Removed)...
> > > Try
> > >
> > > Bookerid = FP_SavedFields("bookerid")
> > >
> > > fp_sQry="SELECT * FROM bookers where id = " & Bookerid
> > >
> > > --
> > >
> > > ==============================================
> > > Thomas A. Rowe (Microsoft MVP - FrontPage)
> > > WEBMASTER Resources(tm)
> > > http://www.ycoln-resources.com
> > > FrontPage Resources, Forums, WebCircle,
> > > MS KB Quick Links, etc.
> > > ==============================================
> > > To assist you in getting the best answers for FrontPage support see:
> > > http://www.net-sites.com/sitebuilder/newsgroups.asp
> > >
> > > "Jackie" <(E-Mail Removed)> wrote in message
> > > news:bobee7$flj$(E-Mail Removed)...
> > > > I'm stuck on the correct syntax for an access database select

> statement,
> > > if
> > > > what I'm trying to do is even possible within a DRW! Can anyone

> advise,
> > > > please?
> > > >
> > > > I'm writing the contents of a form to a database. On the

Confirmation
> > page
> > > I
> > > > need to use the value of one of the fields (numeric) to look up a

> record
> > > on
> > > > another table within the same database, so that full details can be
> > > > displayed.
> > > >
> > > > I know that I can't actually use the confirmation field itself, but

> was
> > > > hoping to be able to use <% =FP_SavedFields("bookerid") %> in the

SQL
> > > > statement. I've written it to the confirmation page and know it

> contains
> > > the
> > > > value I need.
> > > >
> > > > My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
> > > > =FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated

string
> > > > constant' error with this.
> > > >
> > > > I've tried all sorts of combinations over the last few hours but I'm

> not
> > > > having any luck and would appreciate some help )
> > > >
> > > > Many thanks,
> > > > Jackie
> > > >
> > > > (XP Pro and FP2002 with server extensions)
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Jackie
Guest
Posts: n/a
 
      6th Nov 2003
Thomas -

I gave up with the various combinations in the end and decided to have a go
at writing my own ASP code for the database retrieval. It's only taken me 10
minutes from knowing nothing to getting it working after all day faffing
about with the DRW yesterday - I didn't realise it was so easy!

All the best,
Jackie


"Jackie" <(E-Mail Removed)> wrote in message
news:boc1t6$iqo$(E-Mail Removed)...
> Thomas -
>
> Bookerid is a numeric field, it's the primary key, an auto-generated

number.
>
> I'll give it a few more tries, then if no-one else can help I guess I'll
> have to bite the bullet and hit the books!
>
> Thanks for your help,
> Jackie
>
>
> "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> news:uPxiMg#(E-Mail Removed)...
> > Personally, I avoid using the FP database component and hand code my

ASP,
> > anyway...
> >
> > Is the bookerid a number or text field in the database?
> >
> > If it is a text field, try:
> >
> > fp_sQry="SELECT * FROM bookers WHERE bookerid = '" & Bookerid & "' "
> >
> > Otherwise, unless someone else can help, it is time to learn to hand

code
> > which will give you a lot more flexibility in the long run, plus you

will
> > have learn ASP.
> >
> > --
> >
> > ==============================================
> > Thomas A. Rowe (Microsoft MVP - FrontPage)
> > WEBMASTER Resources(tm)
> > http://www.ycoln-resources.com
> > FrontPage Resources, Forums, WebCircle,
> > MS KB Quick Links, etc.
> > ==============================================
> > To assist you in getting the best answers for FrontPage support see:
> > http://www.net-sites.com/sitebuilder/newsgroups.asp
> >
> > "Jackie" <(E-Mail Removed)> wrote in message
> > news:bobqlr$pse$(E-Mail Removed)...
> > > Thomas -
> > >
> > > thanks for the reply. I've had a few attempts at this, but with no

> success
> > > so far.
> > >
> > > Nearly everything gets thrown out as invalid syntax when I try to do

it
> > > within the FrontPage database results custom query, except for
> > > fp_sQry="SELECT * FROM bookers WHERE bookerid = "" &Bookerid""" which
> > > results in error : Too few parameters. Expected 2. (I didn't type all

> > those
> > > quotes in, most were generated).
> > >
> > > I've gone into HTML view, but I can't change the fp_sQry ..... line

as
> > > FrontPage changes it back when I try to save.
> > >
> > > I've tried to make the changes to the s-sql= ..... line in the webbot
> > > section above, but whatever I type in there comes out differently in

the
> > > fp_sQry statement when it's saved.
> > >
> > > For example :-
> > >
> > > s-sql="SELECT * FROM bookers WHERE bookerid = "&Bookerid
> > > results in
> > > fp_sQry="SELECT * FROM bookers WHERE bookerid = "
> > > which chops off the end of the statement.
> > >
> > >
> > > s-sql="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> > > results in
> > > fp_sQry="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> > > which gives Invalid SQL statement; expected 'DELETE', 'INSERT',

> > 'PROCEDURE',
> > > 'SELECT', or 'UPDATE'.
> > >
> > > I've tried various combinations of single and double quotes but all

> result
> > > in 'invalid SQL statement' or 'too few parameter' errors.
> > >
> > > Have you any idea how I can format the s-sql statement so that it

comes
> > out
> > > correctly when it's saved to the fp_sQry line?
> > >
> > > Thanks,
> > > Jackie
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> > > news:#(E-Mail Removed)...
> > > > Try
> > > >
> > > > Bookerid = FP_SavedFields("bookerid")
> > > >
> > > > fp_sQry="SELECT * FROM bookers where id = " & Bookerid
> > > >
> > > > --
> > > >
> > > > ==============================================
> > > > Thomas A. Rowe (Microsoft MVP - FrontPage)
> > > > WEBMASTER Resources(tm)
> > > > http://www.ycoln-resources.com
> > > > FrontPage Resources, Forums, WebCircle,
> > > > MS KB Quick Links, etc.
> > > > ==============================================
> > > > To assist you in getting the best answers for FrontPage support see:
> > > > http://www.net-sites.com/sitebuilder/newsgroups.asp
> > > >
> > > > "Jackie" <(E-Mail Removed)> wrote in message
> > > > news:bobee7$flj$(E-Mail Removed)...
> > > > > I'm stuck on the correct syntax for an access database select

> > statement,
> > > > if
> > > > > what I'm trying to do is even possible within a DRW! Can anyone

> > advise,
> > > > > please?
> > > > >
> > > > > I'm writing the contents of a form to a database. On the

> Confirmation
> > > page
> > > > I
> > > > > need to use the value of one of the fields (numeric) to look up a

> > record
> > > > on
> > > > > another table within the same database, so that full details can

be
> > > > > displayed.
> > > > >
> > > > > I know that I can't actually use the confirmation field itself,

but
> > was
> > > > > hoping to be able to use <% =FP_SavedFields("bookerid") %> in the

> SQL
> > > > > statement. I've written it to the confirmation page and know it

> > contains
> > > > the
> > > > > value I need.
> > > > >
> > > > > My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
> > > > > =FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated

> string
> > > > > constant' error with this.
> > > > >
> > > > > I've tried all sorts of combinations over the last few hours but

I'm
> > not
> > > > > having any luck and would appreciate some help )
> > > > >
> > > > > Many thanks,
> > > > > Jackie
> > > > >
> > > > > (XP Pro and FP2002 with server extensions)
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Thomas A. Rowe
Guest
Posts: n/a
 
      6th Nov 2003
Great! This is why I suggest that folks learn to hand code their ASP.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

"Jackie" <(E-Mail Removed)> wrote in message
news:bodc5n$i3m$(E-Mail Removed)...
> Thomas -
>
> I gave up with the various combinations in the end and decided to have a

go
> at writing my own ASP code for the database retrieval. It's only taken me

10
> minutes from knowing nothing to getting it working after all day faffing
> about with the DRW yesterday - I didn't realise it was so easy!
>
> All the best,
> Jackie
>
>
> "Jackie" <(E-Mail Removed)> wrote in message
> news:boc1t6$iqo$(E-Mail Removed)...
> > Thomas -
> >
> > Bookerid is a numeric field, it's the primary key, an auto-generated

> number.
> >
> > I'll give it a few more tries, then if no-one else can help I guess I'll
> > have to bite the bullet and hit the books!
> >
> > Thanks for your help,
> > Jackie
> >
> >
> > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> > news:uPxiMg#(E-Mail Removed)...
> > > Personally, I avoid using the FP database component and hand code my

> ASP,
> > > anyway...
> > >
> > > Is the bookerid a number or text field in the database?
> > >
> > > If it is a text field, try:
> > >
> > > fp_sQry="SELECT * FROM bookers WHERE bookerid = '" & Bookerid & "' "
> > >
> > > Otherwise, unless someone else can help, it is time to learn to hand

> code
> > > which will give you a lot more flexibility in the long run, plus you

> will
> > > have learn ASP.
> > >
> > > --
> > >
> > > ==============================================
> > > Thomas A. Rowe (Microsoft MVP - FrontPage)
> > > WEBMASTER Resources(tm)
> > > http://www.ycoln-resources.com
> > > FrontPage Resources, Forums, WebCircle,
> > > MS KB Quick Links, etc.
> > > ==============================================
> > > To assist you in getting the best answers for FrontPage support see:
> > > http://www.net-sites.com/sitebuilder/newsgroups.asp
> > >
> > > "Jackie" <(E-Mail Removed)> wrote in message
> > > news:bobqlr$pse$(E-Mail Removed)...
> > > > Thomas -
> > > >
> > > > thanks for the reply. I've had a few attempts at this, but with no

> > success
> > > > so far.
> > > >
> > > > Nearly everything gets thrown out as invalid syntax when I try to do

> it
> > > > within the FrontPage database results custom query, except for
> > > > fp_sQry="SELECT * FROM bookers WHERE bookerid = "" &Bookerid"""

which
> > > > results in error : Too few parameters. Expected 2. (I didn't type

all
> > > those
> > > > quotes in, most were generated).
> > > >
> > > > I've gone into HTML view, but I can't change the fp_sQry ..... line

> as
> > > > FrontPage changes it back when I try to save.
> > > >
> > > > I've tried to make the changes to the s-sql= ..... line in the

webbot
> > > > section above, but whatever I type in there comes out differently in

> the
> > > > fp_sQry statement when it's saved.
> > > >
> > > > For example :-
> > > >
> > > > s-sql="SELECT * FROM bookers WHERE bookerid = "&Bookerid
> > > > results in
> > > > fp_sQry="SELECT * FROM bookers WHERE bookerid = "
> > > > which chops off the end of the statement.
> > > >
> > > >
> > > > s-sql="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> > > > results in
> > > > fp_sQry="'SELECT * FROM bookers WHERE bookerid =' &Bookerid"
> > > > which gives Invalid SQL statement; expected 'DELETE', 'INSERT',
> > > 'PROCEDURE',
> > > > 'SELECT', or 'UPDATE'.
> > > >
> > > > I've tried various combinations of single and double quotes but all

> > result
> > > > in 'invalid SQL statement' or 'too few parameter' errors.
> > > >
> > > > Have you any idea how I can format the s-sql statement so that it

> comes
> > > out
> > > > correctly when it's saved to the fp_sQry line?
> > > >
> > > > Thanks,
> > > > Jackie
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > "Thomas A. Rowe" <(E-Mail Removed)> wrote in message
> > > > news:#(E-Mail Removed)...
> > > > > Try
> > > > >
> > > > > Bookerid = FP_SavedFields("bookerid")
> > > > >
> > > > > fp_sQry="SELECT * FROM bookers where id = " & Bookerid
> > > > >
> > > > > --
> > > > >
> > > > > ==============================================
> > > > > Thomas A. Rowe (Microsoft MVP - FrontPage)
> > > > > WEBMASTER Resources(tm)
> > > > > http://www.ycoln-resources.com
> > > > > FrontPage Resources, Forums, WebCircle,
> > > > > MS KB Quick Links, etc.
> > > > > ==============================================
> > > > > To assist you in getting the best answers for FrontPage support

see:
> > > > > http://www.net-sites.com/sitebuilder/newsgroups.asp
> > > > >
> > > > > "Jackie" <(E-Mail Removed)> wrote in message
> > > > > news:bobee7$flj$(E-Mail Removed)...
> > > > > > I'm stuck on the correct syntax for an access database select
> > > statement,
> > > > > if
> > > > > > what I'm trying to do is even possible within a DRW! Can anyone
> > > advise,
> > > > > > please?
> > > > > >
> > > > > > I'm writing the contents of a form to a database. On the

> > Confirmation
> > > > page
> > > > > I
> > > > > > need to use the value of one of the fields (numeric) to look up

a
> > > record
> > > > > on
> > > > > > another table within the same database, so that full details can

> be
> > > > > > displayed.
> > > > > >
> > > > > > I know that I can't actually use the confirmation field itself,

> but
> > > was
> > > > > > hoping to be able to use <% =FP_SavedFields("bookerid") %> in

the
> > SQL
> > > > > > statement. I've written it to the confirmation page and know it
> > > contains
> > > > > the
> > > > > > value I need.
> > > > > >
> > > > > > My HTML code says: fp_sQry="SELECT * FROM bookers where id = <%
> > > > > > =FP_SavedFields(""bookerid"") %>" but I'm getting 'Unterminated

> > string
> > > > > > constant' error with this.
> > > > > >
> > > > > > I've tried all sorts of combinations over the last few hours but

> I'm
> > > not
> > > > > > having any luck and would appreciate some help )
> > > > > >
> > > > > > Many thanks,
> > > > > > Jackie
> > > > > >
> > > > > > (XP Pro and FP2002 with server extensions)
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datatable.select correct syntax sam Microsoft C# .NET 5 27th Aug 2007 10:23 PM
Correct syntax for SELECT statement within a SELECT statement. =?Utf-8?B?R3JlZw==?= Microsoft Access ADP SQL Server 2 16th Oct 2006 09:20 PM
IIf syntax to select one field or another =?Utf-8?B?RG9ubml0aG9ybg==?= Microsoft Access Forms 2 8th May 2006 07:32 PM
What is correct syntax for SQL SELECT statement to read Unicode? =?Utf-8?B?Sm9obiBIYWxs?= Microsoft Dot NET 1 1st May 2005 10:43 PM
correct syntax for ADO.net recordset's Select method. Gordon Goddard Microsoft ADO .NET 0 15th Oct 2003 08:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:29 PM.