473,382 Members | 1,373 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,382 software developers and data experts.

I cannot get this inner join to work in asp

<!--#Include Virtual="/bug/adovbs.inc"-->

<title>Bug Status Board</title>

<%

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
techsupportBT; User Id = sa; Password="
Set rs = server.CreateObject("ADODB.Recordset")

sSQL="SELECT T.BugIndex, T.[Date Entered], T.DESCRIPTION,"
sSQL= ssql &" T.Company, T.Technician, T.Developer, T.PROGRAM, "
sSQL= ssql &" T.Status, T.PRIORITY, T.[Version Fix], n.noc"
sSQL= ssql &"FROM TSHIGHISSUES INNER JOIN noc ON T.BugIndex =
n.bugindex "

set rs=conn.Execute(ssql)

and this is the error message that I get
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near the keyword 'INNER'

I cannot find an example anywhere that helps with this situation.
This works fine in SQL, but for some reason asp is being a pain.
Jul 19 '05 #1
3 2347
You forgot to alias the tables:

FROM TSHIGHISSUES T INNER JOIN noc n ON

--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"the chad" <cs*****@stromberg.com> wrote in message
news:d5**************************@posting.google.c om...
<!--#Include Virtual="/bug/adovbs.inc"-->

<title>Bug Status Board</title>

<%

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
techsupportBT; User Id = sa; Password="
Set rs = server.CreateObject("ADODB.Recordset")

sSQL="SELECT T.BugIndex, T.[Date Entered], T.DESCRIPTION,"
sSQL= ssql &" T.Company, T.Technician, T.Developer, T.PROGRAM, "
sSQL= ssql &" T.Status, T.PRIORITY, T.[Version Fix], n.noc"
sSQL= ssql &"FROM TSHIGHISSUES INNER JOIN noc ON T.BugIndex =
n.bugindex "

set rs=conn.Execute(ssql)

and this is the error message that I get
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Incorrect syntax near the keyword 'INNER'

I cannot find an example anywhere that helps with this situation.
This works fine in SQL, but for some reason asp is being a pain.

Jul 19 '05 #2
Try this
you should say
" from tableone inner join tabletwo on tableone.field=tabletwo.field;"

sSQL="SELECT [T].[BugIndex], [T].[Date Entered], [T].[DESCRIPTION],"
sSQL= ssql &" [T].[Company], [T].[Technician], [T].[Developer],
[T].[PROGRAM], "
sSQL= ssql &" [T].[Status], [T].[PRIORITY], [T].[Version Fix], [n].[noc]"
sSQL= ssql &" FROM [T] INNER JOIN [n] ON [T].[BugIndex] = [n].[bugindex];"
Jul 19 '05 #3


Thank you very much for all of your help. But you know how when you
think you are done with a project, you think of seomthing else that
would be nice to add? Well I thought of one that I cannot figure out.

This web page returns a result into another page called noc,when you
select the bug# from the primary page.The noc page Then displays the
bug# with a description and the noc(number of calls). I would like to be
able to update the noc from the noc page. This is my page as it stands
right now.
<!--#Include Virtual="/bug/adovbs.inc"-->
<title>Number of Calls</title>
<%
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source = (local); Initial Catalog =
techsupportBT; User Id = sa; Password="
Set rsNOC = server.CreateObject("ADODB.Recordset")
strBugIndex = trim(Request.QueryString("bindex"))
strSql = "Select n.bugindex, t.description, n.noc "
strSql = strSql & "from NOC n, tshighissues t "
strSql = strSql & "where n.BugIndex = " & strBugIndex & " "
strSql = strSql & "And t.BugIndex = n.BugIndex "
set rsNOC=conn.Execute(strSql)
%><body bgcolor="#E8E8EA"><div align="left">
<p>
<a href="bug2.asp">
<img border="0" src="hdr_logo.jpg" width="240" height="37"></a> </p>
<p align="left">
<u><font size="6"
color="#94B2C6"><b><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;
Bug Status
Board&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;
</i></b></font></u></p>
&nbsp;<Table bordercolorlight="#94B2C6" bordercolordark="#000080"
border="2" bordercolor="#F3F3F3" align="left" width="100%">
<tr>
<th height="28">Bug #</th>
<th height="28">Description</th>
<th height="28">NOC</th>

</tr>
<%
While not rsNOC.EOF
%>
<tr>
<td><%=rsNOC.fields(0)%></td>
<td><%=rsNOC.fields(1)%></td>
<td><%=rsNOC.fields(2)%></td>

</tr>
</div>

What do you think would be the best way to add an update script into
this page to be able to update the noc column?

<%
rsNOC.MoveNext()
Wend
%><Close recrordsets and connection></body></html>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

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

Similar topics

0
by: David | last post by:
Hi, I have a MySQL database and in the front-end software I am using to Run MySQL, I have created a query on the tables which runs in the front-end, similar to the MS Access query grid. I now...
10
by: Ike | last post by:
For some reason, I have a rather large (to me) query, with numerous inner joins, accessing a remote server, and it is taking about twenty times longer than most queries to the same database. The...
9
by: majsen | last post by:
Hi, I have problem running this query. It will time out for me... My database are small just about 200 members. I have a site for swaping appartments (rental). my query should look for match in...
1
by: teddysnips | last post by:
FRONT END: ACCESS 2000 SP3 BACK END: SQL SERVER 2000 I have been making some modifications to the front end, and a completely unrelated error has occurred. It is unrelated, because the...
6
by: dmonroe | last post by:
hi group -- Im having a nested inner join problem with an Access SQl statement/Query design. Im running the query from ASP and not usng the access interface at all. Here's the tables: ...
4
by: peashoe | last post by:
I get the following error: ADODB.Field error '80020009' Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. This is my code: ' Get...
5
by: Ferasse | last post by:
Hi, I'm an occasional Ms-Access developer, so there is still a lot of stuff that I don't get... Right now, I'm working on a database that stores contractual information. One of the form that...
4
by: AXESMI59 | last post by:
I created a query in the Access Query Builder that I modified to use with VBA Code so I could reuse it for any record I choose. The one that I created with the Access Query builder works beautifully...
4
OraMaster
by: OraMaster | last post by:
Hi All, Below is the detail on this SQL. Rows returned : 28000 Time taken: 7 to 20 mins Please let me know whether all joins are correct or not. Also this SQL return mentioned rows with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.