Ask a Question related to ASP Database, Design and Development.
-
Maria Kovacs #1
Pls help with Error Message
I am reusing a code that has been already working fine in another part
of our website. I am using the same table structure and datatypes too.
I am getting the following error message:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'CustomerID ='.
/test/ins_VIPPuserlinks.asp, line 183
This is the statement where the problem is:
user_id = session("user_id")
CustomerID = request("CustomerID")
set rs = cn.Execute("SELECT Supplier, Web_Address FROM VIPP WHERE
CustomerID = " & CustomerID)
if not rs.EOF then
Supplier = rs("Supplier")
VIPP_URL = rs("Web_Address")
NOTE: Customer ID is an AutoNumber in my VIPP table and Number in my
User_Links table.
Code from Links page to add link to favorits:
<% if session("user_id") <> "" then %>[<A
href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'
class='labelTD'>add to favorites</A>]<% end if %>
I can't figure out where I am missing the missing operator...please
HELP!
Maria Kovacs Guest
-
How To Supress Acrobat Error Message And Alert Message
Is there any way to supress those pop up message? If can't, is there any way to catch it? -
error message: Microsoft JScript compilation error '800a03ec'
Recieved following error message: Microsoft JScript compilation error '800a03ec' Expected ';' ... -
Error Message When Sending Message In Windows Mail
Am I the only one getting an error message when replying to a posted message using Windows Mail. Every time I send a message I get a popup error... -
Error Message "A drawing error ocurrred which is probably due to an out-of-memory condition. Try qu
I am running Acrobat Reader 5.0 on a Mac Powerbook running OS 9.2 and keep getting "A drawing error occurred which is probably due to an out of... -
ODBC has error but no error message displayed
Hi All.. This is a strange one that I hope someone has come across. I have an asp.net application that needs to access a flat file databse via... -
Raymond D'Anjou \(raydan\) #2
Re: Pls help with Error Message
response.write "SELECT Supplier, Web_Address FROM VIPP WHERE
CustomerID = " & CustomerID
response.end
before cn.Execute
and you'll see the problem.
request("CustomerID") is returning an empty string.
"Maria Kovacs" <mariakovacs@lycos.com> wrote in message
news:6f76be22.0310091217.459f081@posting.google.co m...> I am reusing a code that has been already working fine in another part
> of our website. I am using the same table structure and datatypes too.
> I am getting the following error message:
>
> Microsoft JET Database Engine error '80040e14'
> Syntax error (missing operator) in query expression 'CustomerID ='.
> /test/ins_VIPPuserlinks.asp, line 183
>
> This is the statement where the problem is:
> user_id = session("user_id")
> CustomerID = request("CustomerID")
> set rs = cn.Execute("SELECT Supplier, Web_Address FROM VIPP WHERE
> CustomerID = " & CustomerID)
> if not rs.EOF then
> Supplier = rs("Supplier")
> VIPP_URL = rs("Web_Address")
>
> NOTE: Customer ID is an AutoNumber in my VIPP table and Number in my
> User_Links table.
>
> Code from Links page to add link to favorits:
> <% if session("user_id") <> "" then %>[<A
> href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'
> class='labelTD'>add to favorites</A>]<% end if %>
>
> I can't figure out where I am missing the missing operator...please
> HELP!
Raymond D'Anjou \(raydan\) Guest
-
Raymond D'Anjou \(raydan\) #3
Re: Pls help with Error Message
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ekcQ9VqjDHA.2068@TK2MSFTNGP09.phx.gbl...I have pages where a value is passed either through request.form("value") or> And after you get that working right, change your code to specify what
> collection you're trying to pull the value from. Request.FORM, .COOKIES,
> .QUERYSTRING, etc.
request.querystring("value").
I use request("value") all the time in this case without specifying where
it's coming from.
Raymond D'Anjou \(raydan\) Guest
-
Ray at #4
Re: Pls help with Error Message
And after you get that working right, change your code to specify what
collection you're trying to pull the value from. Request.FORM, .COOKIES,
..QUERYSTRING, etc.
Ray at work
"Raymond D'Anjou (raydan)" <raydan@canatrade.nospamcom> wrote in message
news:edLQLQqjDHA.360@TK2MSFTNGP10.phx.gbl...> response.write "SELECT Supplier, Web_Address FROM VIPP WHERE
> CustomerID = " & CustomerID
> response.end
>
> before cn.Execute
> and you'll see the problem.
> request("CustomerID") is returning an empty string.
>
> "Maria Kovacs" <mariakovacs@lycos.com> wrote in message
> news:6f76be22.0310091217.459f081@posting.google.co m...>> > I am reusing a code that has been already working fine in another part
> > of our website. I am using the same table structure and datatypes too.
> > I am getting the following error message:
> >
> > Microsoft JET Database Engine error '80040e14'
> > Syntax error (missing operator) in query expression 'CustomerID ='.
> > /test/ins_VIPPuserlinks.asp, line 183
> >
> > This is the statement where the problem is:
> > user_id = session("user_id")
> > CustomerID = request("CustomerID")
> > set rs = cn.Execute("SELECT Supplier, Web_Address FROM VIPP WHERE
> > CustomerID = " & CustomerID)
> > if not rs.EOF then
> > Supplier = rs("Supplier")
> > VIPP_URL = rs("Web_Address")
> >
> > NOTE: Customer ID is an AutoNumber in my VIPP table and Number in my
> > User_Links table.
> >
> > Code from Links page to add link to favorits:
> > <% if session("user_id") <> "" then %>[<A
> > href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'
> > class='labelTD'>add to favorites</A>]<% end if %>
> >
> > I can't figure out where I am missing the missing operator...please
> > HELP!
>
Ray at Guest
-
Ray at #5
Re: Pls help with Error Message
I suggest you don't do that. Decide which one is more important, and use
if/then to get the value.
sVal = REquest.Querystring("value")
If sVal = "" Then sVal = Request.Form("value")
Ray at work
"Raymond D'Anjou (raydan)" <raydan@canatrade.nospamcom> wrote in message
news:OPG0iaqjDHA.2232@TK2MSFTNGP09.phx.gbl.....COOKIES,> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
> news:ekcQ9VqjDHA.2068@TK2MSFTNGP09.phx.gbl...> > And after you get that working right, change your code to specify what
> > collection you're trying to pull the value from. Request.FORM,or>> > .QUERYSTRING, etc.
> I have pages where a value is passed either through request.form("value")> request.querystring("value").
> I use request("value") all the time in this case without specifying where
> it's coming from.
>
>
Ray at Guest
-
Aaron Bertrand - MVP #6
Re: Pls help with Error Message
> I have pages where a value is passed either through request.form("value")
orUgh. What happens when you foolishly name a form element something that the> request.querystring("value").
> I use request("value") all the time in this case without specifying where
> it's coming from.
browser is posting into servervariables? Or when another developer creates
a cookie with the same key name as one of your form elements? See this
article: [url]http://www.aspfaq.com/2111[/url]
Aaron Bertrand - MVP Guest
-
Raymond D'Anjou \(raydan\) #7
Re: Pls help with Error Message
I was going to ask Ray WHY.
Sorry, I guess I'm running with the wrong crowd at work.
I'm try to show them the right path.
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:uZMUolqjDHA.1096@TK2MSFTNGP11.phx.gbl...request.form("value")> > I have pages where a value is passed either throughwhere> or> > request.querystring("value").
> > I use request("value") all the time in this case without specifyingthe>> > it's coming from.
> Ugh. What happens when you foolishly name a form element something thatcreates> browser is posting into servervariables? Or when another developer> a cookie with the same key name as one of your form elements? See this
> article: [url]http://www.aspfaq.com/2111[/url]
>
>
Raymond D'Anjou \(raydan\) Guest
-
Maria Kovacs #8
Re: Pls help with Error Message
I think I found where my problem is. I just don't know how to fix it,
I am fairly new with ASP...so please bear with me.
So I traced the problem back to the previous page that is although I
have the sql statement correct my CustomerID does not get selected.
Generally I am displaying records into a table like this:
<td><%= rs("CustomerID") %></td>
Which works...but I need to carry the customerID over to the next page
so my code looks like this:
<% if session("user_id") <> "" then %>[<A
href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'>add to
favorites</A>]<% end if %>
Unfortunately then instead of the page ins_VIPPuserlinks.asp I get the
error message that the CusomterID is missing the value.
The code for ins_VIPPuserlinks.asp is here:
[url]http://cliq-on.com/test/vipp.txt[/url]
Maria Kovacs Guest
-
Ray at #9
Re: Pls help with Error Message
Hi Maria,
To carry values from one page to another, you either use cookies,
session/application varibles, form data, querystring, or probably something
else I'm not thinking of.
How are you getting from page1 to page2? Is it by a server-side redirect,
or is it when the user clicks a link?
Also, you should use:
<%=rs.Fields.Item("CustomerID").Value%> instead of <%=rs("CustomerID")%>
If you're new to ASP, try to get yourself in that habit now of not relying
on default properties. It'll save you headaches.
Ray at home
"Maria Kovacs" <mariakovacs@lycos.com> wrote in message
news:6f76be22.0310130948.518d95d4@posting.google.c om...> I think I found where my problem is. I just don't know how to fix it,
> I am fairly new with ASP...so please bear with me.
>
> So I traced the problem back to the previous page that is although I
> have the sql statement correct my CustomerID does not get selected.
>
> Generally I am displaying records into a table like this:
> <td><%= rs("CustomerID") %></td>
> Which works...but I need to carry the customerID over to the next page
> so my code looks like this:
>
> <% if session("user_id") <> "" then %>[<A
> href='ins_VIPPuserlinks.asp?CustomerID=<% =CustomerID %>'>add to
> favorites</A>]<% end if %>
>
> Unfortunately then instead of the page ins_VIPPuserlinks.asp I get the
> error message that the CusomterID is missing the value.
>
> The code for ins_VIPPuserlinks.asp is here:
> [url]http://cliq-on.com/test/vipp.txt[/url]
Ray at Guest
-
Maria Kovacs #10
Re: Pls help with Error Message
Hi Ray,
You are right! I will corrected properties as you suggested and
suddenly things began to work that until now were a pain to figure
out.
Now I actually managed to pull the CustomerID into a link ex.:
.../test/ins_VIPPuserlinks.asp?CustomerID=78
I managed to pull most of the values that need to show or inserted.
However when I click the confirm insert button of the form it seems to
clear the form instead of inserting values. What would be the reason
for that?
I have another question. One of the values that will be inserted into
the favorits table (VIPPid(Autonumber), user_id, CustomerID), is an
autonumber. How would I go about it in my insert statement? Do I need
to list it or it gets generated automatically?
I am getting from page 1 to 2 by clicking an "Add to Favorits" link> How are you getting from page1 to page2? Is it by a server-side redirect,
> or is it when the user clicks a link?
that goes through a page that has all the the functions for
adding/updating/deleting these favorits. On this page I actually have
a small form that confirms the data insert. That form calls a function
inside the same page and "redirects" to the same page with a message
whether the insert was successful.
I am sorry if I am hazy on some of the explanation but I feel like I
am swimming in deep water here. Until now I just installed ready to
use codes, but now I am actually trying to add to them by myself. The
fact that I never studied programming does not help... :)
Maria
Maria Kovacs Guest
-
Ray at #11
Re: Pls help with Error Message
It will be inserted automatically. Just leave the column out of your insert
command altogether.
INSERT INTO TheTable ([user_id],[CustomerID]) VALUES ('x','y')
Ray at work
"Maria Kovacs" <mariakovacs@lycos.com> wrote in message
news:6f76be22.0310141042.371e4bbc@posting.google.c om...
>
> I have another question. One of the values that will be inserted into
> the favorits table (VIPPid(Autonumber), user_id, CustomerID), is an
> autonumber. How would I go about it in my insert statement? Do I need
> to list it or it gets generated automatically?
Ray at Guest



Reply With Quote

