473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Stuck with an "Expected end of statement" error

Hello All

I was wondering if someone could offer a rather inexperienced person
some advice.

Im trying to get my asp page to look at an access data

I created the following query in access and it worked running it in
access.
However when i paste it into the asp page i get an "Expected end of
statement"

The code is as follows
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
Dim strSQL
strSQL = "SELECT DISTINCT tblEventType.strEventTypeDescription,
tblEvent.strEventName "
strSQL = StrSQL & "FROM tblEventType INNER JOIN (tblVenue INNER JOIN "
strSQL = StrSQL & "(tblEvent INNER JOIN tblLINKVenue_Event ON
tblEvent.lngEventID = tblLINKVenue_Event.lngEventID) "
strSQL = StrSQL & "ON tblVenue.lngVenueID =
tblLINKVenue_Event.lngVenueID) ON "
strSQL = StrSQL & "tblEventType.lngEventTypeID =
tblEvent.lngEventTypeID "
strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)="Birthday s")) "
strSQL = StrSQL & "ORDER BY tblEvent.strEventName"
strSQL = StrSQL & ";"
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++

When i remove
__________________________________________________ _____________________
strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)="Birthday s")) "
__________________________________________________ _____________________

It doesnt give this error and outputs records from the database
Can anyone see why this line is causing the error

Thanks in advance
Nov 13 '05 #1
3 5561
You've got a problem with your quotes. You need either:

strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)=""Birthda ys"")) "

or

strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)='Birthday s')) "
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"NeilH" <ne**********@ntlworld.com> wrote in message
news:75**************************@posting.google.c om...
Hello All

I was wondering if someone could offer a rather inexperienced person
some advice.

Im trying to get my asp page to look at an access data

I created the following query in access and it worked running it in
access.
However when i paste it into the asp page i get an "Expected end of
statement"

The code is as follows
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
Dim strSQL
strSQL = "SELECT DISTINCT tblEventType.strEventTypeDescription,
tblEvent.strEventName "
strSQL = StrSQL & "FROM tblEventType INNER JOIN (tblVenue INNER JOIN "
strSQL = StrSQL & "(tblEvent INNER JOIN tblLINKVenue_Event ON
tblEvent.lngEventID = tblLINKVenue_Event.lngEventID) "
strSQL = StrSQL & "ON tblVenue.lngVenueID =
tblLINKVenue_Event.lngVenueID) ON "
strSQL = StrSQL & "tblEventType.lngEventTypeID =
tblEvent.lngEventTypeID "
strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)="Birthday s")) "
strSQL = StrSQL & "ORDER BY tblEvent.strEventName"
strSQL = StrSQL & ";"
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++

When i remove
__________________________________________________ _____________________
strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)="Birthday s")) "
__________________________________________________ _____________________

It doesnt give this error and outputs records from the database
Can anyone see why this line is causing the error

Thanks in advance

Nov 13 '05 #2
ne**********@ntlworld.com (NeilH) wrote in message news:<75**************************@posting.google. com>...
Hello All

I was wondering if someone could offer a rather inexperienced person
some advice.

Im trying to get my asp page to look at an access data

I created the following query in access and it worked running it in
access.
However when i paste it into the asp page i get an "Expected end of
statement"

The code is as follows
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
Dim strSQL
strSQL = "SELECT DISTINCT tblEventType.strEventTypeDescription,
tblEvent.strEventName "
strSQL = StrSQL & "FROM tblEventType INNER JOIN (tblVenue INNER JOIN "
strSQL = StrSQL & "(tblEvent INNER JOIN tblLINKVenue_Event ON
tblEvent.lngEventID = tblLINKVenue_Event.lngEventID) "
strSQL = StrSQL & "ON tblVenue.lngVenueID =
tblLINKVenue_Event.lngVenueID) ON "
strSQL = StrSQL & "tblEventType.lngEventTypeID =
tblEvent.lngEventTypeID "
strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)="Birthday s")) "
strSQL = StrSQL & "ORDER BY tblEvent.strEventName"
strSQL = StrSQL & ";"
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++

When i remove
__________________________________________________ _____________________
strSQL = StrSQL & "WHERE
(((tblEventType.strEventTypeDescription)="Birthday s")) "
__________________________________________________ _____________________

It doesnt give this error and outputs records from the database
Can anyone see why this line is causing the error

Thanks in advance

Really easy. You can't use double quotes inside your SQL statement
because double-quotes are string delimiters in VB/VBA. So you need to
change this:

(((tblEventType.strEventTypeDescription)="Birthday s")) "

to this:

(((tblEventType.strEventTypeDescription)='Birthday s')) "

Notice the _single_ quotes around the literal text, 'Birthdays'.
Nov 13 '05 #3
Thanks for the help

worked a treat

One down one to go!!!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Phil Powell | last post by:
Here is the function ArraySearch: '-------------------------------------------------------------------------------------- 'ArraySearch will return an integer value indicating the first...
5
by: Rick | last post by:
I wrote the following code as part of a page where users can reorder a list of items by highlighting an item in a list box and clicking an "up" or "down" button to move the items around. The code...
2
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton...
7
by: Aaron G via AccessMonster.com | last post by:
Wanted to share a solution to something which I didn't find on the net: EVERY form in my Microsoft Access 2002 database gave an error any time any code was to be called: form OnOpen, button...
3
by: rdi | last post by:
The import statements weren't copy/pasted, but everything INSIDE the class WAS copy pasted from the help file. Starting with the myMail.From line and going down to the SmtpMail.Send line, EVERY line...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
4
by: Tran Hong Quang | last post by:
Hi, I'm using Windows 2000, English version, Microsoft Visual Studio.Net 2003. I compile a project developed for Japanese client, on which there are some Japanese messages. I have error "End of...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
2
by: jman | last post by:
i'm getting an "object expected" error in ie - not ff. in the BODY onload attribute i call a function that's loaded from an external file. i've narrowed the error down to the fact it cannot...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.