473,325 Members | 2,860 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,325 software developers and data experts.

sql statement error - Please look

hi guys - pulling my hair out with this one...
code:-----------------------------------------------------------------------
-------
Dim oRs As ADODB.Recordset
Dim strSQLString As String

strSQLString = "SELECT"
strSQLString = strSQLString & " customer.*,"
strSQLString = strSQLString & " Hardware.hardwaretype,"
strSQLString = strSQLString & " Hardware.hardwaredesc,"
strSQLString = strSQLString & " Hardware.hardwareprice,"
strSQLString = strSQLString & " Invoiced.TransactionDate,"
strSQLString = strSQLString & " Invoiced.TransactionAmount,"
strSQLString = strSQLString & " Invoiced.TransactionNumber"
strSQLString = strSQLString & " FROM"
strSQLString = strSQLString & " Hardware"
strSQLString = strSQLString & " INNER JOIN"
strSQLString = strSQLString & " (customer"
strSQLString = strSQLString & " INNER JOIN"
strSQLString = strSQLString & " Invoiced ON Customer.CustomerID =
Invoiced.CustomerID "
strSQLString = strSQLString & " ON hardware.hardwareidID =
Invoiced.hardwareID)"
strSQLString = strSQLString & " WHERE (Invoiced.TransactionNumber = " &
InvToFind & ")"
----------------------------------------------------------------------------
--
im getting syntax error on the where line..

anyone know where im going wrong?

fenster.
Nov 12 '05 #1
2 1439

"Fred" <re**********@btinternet.com> wrote in message
news:bj**********@hercules.btinternet.com...
hi guys - pulling my hair out with this one...
code:----------------------------------------------------------------------- -------
Dim oRs As ADODB.Recordset
Dim strSQLString As String

strSQLString = "SELECT"
strSQLString = strSQLString & " customer.*,"
strSQLString = strSQLString & " Hardware.hardwaretype,"
strSQLString = strSQLString & " Hardware.hardwaredesc,"
strSQLString = strSQLString & " Hardware.hardwareprice,"
strSQLString = strSQLString & " Invoiced.TransactionDate,"
strSQLString = strSQLString & " Invoiced.TransactionAmount,"
strSQLString = strSQLString & " Invoiced.TransactionNumber"
strSQLString = strSQLString & " FROM"
strSQLString = strSQLString & " Hardware"
strSQLString = strSQLString & " INNER JOIN"
strSQLString = strSQLString & " (customer"
strSQLString = strSQLString & " INNER JOIN"
strSQLString = strSQLString & " Invoiced ON Customer.CustomerID =
Invoiced.CustomerID "
strSQLString = strSQLString & " ON hardware.hardwareidID =
Invoiced.hardwareID)"
strSQLString = strSQLString & " WHERE (Invoiced.TransactionNumber = " & InvToFind & ")"
-------------------------------------------------------------------------- -- --
im getting syntax error on the where line..

anyone know where im going wrong?

fenster.


Once you've created the SQL string put Debug.Print strSQL and exit before
trying to open the recordset. You can cut and paste the resulting string
from the immediate window (CTRL-G) into the query designer - which may help
you identify the problem.
At a guess, I would look here first

" WHERE (Invoiced.TransactionNumber = " & InvToFind & ")"

Make sure InvToFind is not causing the problem - Is it null, is it
alphanumeric, etc?
Fletcher
Nov 12 '05 #2
"Fred" <re**********@btinternet.com> wrote in message
news:bj**********@titan.btinternet.com...
Hi Fletcher..

heres the dump from query analyzer in access:
SELECT Customer.*, HardWare.HardwareType, HardWare.HardwareDesc,
HardWare.HardwarePrice, Invoiced.TransactionDate,
Invoiced.TransactionAmount, Invoiced.TransactionNumber
FROM HardWare INNER JOIN (Customer INNER JOIN Invoiced ON
Customer.CustomerID=Invoiced.CustomerID) ON
HardWare.HardwareID=Invoiced.HardwareID
WHERE (((Invoiced.TransactionNumber)=1));
the invtofind is good - numeric 1 when testing...
davie.

Try designing it graphically, and checking how the SQL which Access
generates compares to yours.
Nov 12 '05 #3

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

Similar topics

1
by: newbie_mw | last post by:
Seems my post was buried in more cries for help :-) I will try again. It's probably a very novice question so please take a look! Thanks!...
9
by: Brandon | last post by:
Greetings, I am having a problem getting a SQL statement that is functional in Access 2K to work in ASP. My Access SQL statement is this: SELECT DateAdd('s',Ticket_Opened_Date,'Dec 31, 1969...
1
by: Jack | last post by:
Hi, I got a asp page where I am getting the following error. (Line 126 is actually the RS.open statement.) ERROR MESSAGE Technical Information (for support personnel) Error Type:
8
by: dark.saintzero | last post by:
Please i would like someone to assist me. I am new to the SQL and how to use it...I need to know how to efficiently use the SELECT statement through error messages from our server. I look forward...
10
by: ale.of.ginger | last post by:
Greetings! I am trying to make a multiplayer (no AI, 2 person) game of tic tac toe in Python. So far it has been pretty simple. My only concern is with the win checking to see if a person has...
6
by: FayeC | last post by:
I really need help figuring this out. i have a db with mostly text fields but 2. The user_id field is an autonumber (key) and the user_newsletter is a number (1 and 0) field meaning 1 yes the ...
35
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is...
6
by: sghi | last post by:
Hi All, I'm new to this group and quite new to access/vba. So, shortly after beginning to write a simple application for my wife, I came across a blocking problem: I need to intercept the sql...
13
by: eman1000 | last post by:
I was recently looking at the prototype library (http://prototype.conio.net/) and I noticed the author used the following syntax: Object.extend(MyObj.prototype, { my_meth1: function(){},...
15
by: gjoneshtfc | last post by:
Hello, I have a simple problem that I just cannot get my head around! I currently have the following line in my ASP recordset: Recordset1.Source = "SELECT * FROM MainTable ORDER BY Price ASC"...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.