472,355 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

inner join query in access not working- can anyone look into this pls


I have 2 tables in access: tblUrl (software Url, contract number- 2 columns)
and tblAccContract(4 columns-accountid, contract id, contract date, email addr)

I am querying these two tables using inner join. I get the result properly, but unable to retrieve the values from those tables. I think the problem is with the query I used for joining these two tables.

Please check with this:

The output has to be like:"Download your software here: www.google.com...."
But it says: "Download your software here..."
It doesnt display the Url in the tblUrl table

code is:

strSQL ="SELECT tblAccContract.accountId,tblAccContract.emailAddr, tblAccContract.contractNo, tblUrl.softwareUrl"
strSQL =strSQL & " FROM tblAccContract INNER JOIN tblUrl ON tblAccContract.contractNo = tblUrl.contractNo"
strSQL =strSQL & " WHERE (tblAccContract.emailAddr)='" & strEmail &"'"
objRS.open strSQL,conn
response.write strUrl

Anyone familiar with this - please check with the code....I just need to get the values from multiple tables when Join is sued in Access.

May 22 '07 #1
1 1995
3,406 Expert 2GB

Welcome to the scripts DN.

I've never used "inner Join" before. you can relate the tables like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM tblAccContract, tblUrl WHERE tblAccContract.contractNo = tblUrl.contractNo AND emailAddr='" & strEmail &"'"
That said, I don't know why your code didn't work. I would suggest trying this and putting in a simple loop to list everything in the record set to troublshoot:
Expand|Select|Wrap|Line Numbers
  1. for each x in objRS.fields
  2.    response.write x & ": " & objRS(x) & "<br>" & vbNewLine
  3. next
Let me know if this helps.

May 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Barry Young | last post by:
I am using Access to create a SQL query. It creates an Inner Join Query. I cut and paste the query into PL-SQL. When I try to execute the query I get an error. ORA 933 SQL command not properly...
by: news-east.earthlink.net | last post by:
The scenario: two tables CustomerTable --------------- CustomerID OrderID CustomerName CustomerEmail
by: Martin Lacoste | last post by:
Access 2000 Trying even the most basic queries - select queries joining (inner join) two tables - and the results are not updatable, and I can't tell why they aren't. All permissions are on,...
by: LemonHead | last post by:
What is the syntax for an inner join when writing a inner join within a module ? I can not figure out why on some modules I see people using a parenthesis when writing an inner join ? See...
by: bob | last post by:
what's the difference between inner join and outer join in sql?
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: ...
by: janko.klemensek | last post by:
Hello. In the following query: SELECT tblDokumentiDetails.ID_Artikel, - tblDokumentiDetails.Kolicina AS Kolicina FROM (tblDokumenti INNER JOIN tblDokumentiDetails ON tblDokumenti.ID_Dokument...
by: Chamnap | last post by:
Hello, everyone I have one question about the standard join and inner join, which one is faster and more reliable? Can you recommend me to use? Please, explain me... Thanks Chamnap
by: shapper | last post by:
Hello, I am used to SQL but I am starting to use LINQ. How can I create Left, Right and Inner joins in LINQ? How to distinguish the different joins? Here is a great SQL example:...
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...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.