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

C# 2.0 + MS Access == Error

Hi,
I am using C# 2.0 along with MS Access database. All my queries are
working perfectly fine, but one inner join query is ocntinously
throwing. I ahve tried it both from code and running explicitly throw
query builder, but to no avail. Query is

"SELECT * FROM COMPANY_ITEM_PRICE as CIP
INNER JOIN ITEM as I ON I.ITEM_ID = CIP.ITEM_ID WHERE CIP.COMPANY_ID =
1 ORDER BY I.NAME"

The error its throwing is,

System.Data.OleDb.OleDbException: No value given for one or more
required parameters.
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextF orSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText( Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(Comm andBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteReader(Comma ndBehavior
behavior)
at
System.Data.OleDb.OleDbCommand.System.Data.IDbComm and.ExecuteReader(CommandBehavior
behavior)
at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)

Can anyone please tell me whats wrong iwth the query.

Oct 20 '06 #1
3 1827
"Omer" <om*******@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
"SELECT * FROM COMPANY_ITEM_PRICE as CIP
INNER JOIN ITEM as I ON I.ITEM_ID = CIP.ITEM_ID WHERE CIP.COMPANY_ID =
1 ORDER BY I.NAME"
Can anyone please tell me whats wrong iwth the query.
It's been absolutely ages since I worked with the Jet database, but I'm
wondering if ITEM might be a reserved word...

What happens if you put square brackes round it i.e. ... INNER JOIN [ITEM]
AS I ...

Also, if you have a full copy of Access, try building the query in the Query
designer and then look at the SQL it generates...
Oct 20 '06 #2
Check that COMPANY_ID isn't a text field, if it is the wrap the 1 in
quotes.

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/

Omer wrote:
Hi,
I am using C# 2.0 along with MS Access database. All my queries are
working perfectly fine, but one inner join query is ocntinously
throwing. I ahve tried it both from code and running explicitly throw
query builder, but to no avail. Query is

"SELECT * FROM COMPANY_ITEM_PRICE as CIP
INNER JOIN ITEM as I ON I.ITEM_ID = CIP.ITEM_ID WHERE CIP.COMPANY_ID =
1 ORDER BY I.NAME"

Can anyone please tell me whats wrong iwth the query.
Oct 20 '06 #3
Mark, ITEM is working fine with all my other queries. Chris, I have
checked it again, COMPANY_ID is a NUMber :(

Chris Fulstow wrote:
Check that COMPANY_ID isn't a text field, if it is the wrap the 1 in
quotes.

--
Chris Fulstow
MCP, MCTS
http://chrisfulstow.blogspot.com/

Omer wrote:
Hi,
I am using C# 2.0 along with MS Access database. All my queries are
working perfectly fine, but one inner join query is ocntinously
throwing. I ahve tried it both from code and running explicitly throw
query builder, but to no avail. Query is

"SELECT * FROM COMPANY_ITEM_PRICE as CIP
INNER JOIN ITEM as I ON I.ITEM_ID = CIP.ITEM_ID WHERE CIP.COMPANY_ID =
1 ORDER BY I.NAME"

Can anyone please tell me whats wrong iwth the query.
Oct 20 '06 #4

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

Similar topics

3
by: Nicola | last post by:
Hi Everyone, I am new to programming and would like to know how to open an access Report from within vb 6. I am trying to write a program to organise cross stitch threads. I have found out how...
4
by: Fabian von Romberg | last post by:
Hi, I have installed Sql Reporting Services on 2 machines, one is WIN 2000 PRO and the other one is WIN 2000 ADV. SERVER. When I try to access a report using the webbrowser, I get the following...
1
by: annie | last post by:
Hi all, I have recently ported my Access 2000 app to SQL Server, keeping the Access client as the front end using linked tables. I am also using triggers on my SQL tables to trap orphan...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
9
by: Fish Womper | last post by:
I am at best a part time developer of Access databases. I use Access 2.0, as this is all my employer has on its computers. Even so, to use this ancient version requires a fairly convoluted...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
8
by: Greg Strong | last post by:
Hello All, The short questions are 1 Do you know how to make DSN connection close in Access to Oracle 10g Express Edition? &/or 2 Do you know how to make a DSN-less pass-through query...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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
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
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...

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.