Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get this Where clause in query builder to work 1

Status
Not open for further replies.

simple99

MIS
Jun 18, 2007
71
AU
In Visual studio 2005, I'm setting up a dataset for a Access database driven website.

I'm trying to add a method to a Table Adapter and trying to create the following query using the Query Builder. But it complains about the '@' symbol.

SELECT Arch_ID, Surname, Firstname, Gender, Date_of_Birth, Date_of_Death, Biography, Sources
FROM Architects
WHERE Arch_ID = @Arch_ID

Can figure out whats wrong with it. I want this query to get only Architects based on supplied @Arch_ID.
 
Hi Simple99,
You need to use a ? for an Access database.

WHERE Arch_ID = ?

woogoo
 
woogoo thansk for the reply,

I tried ? instead of @ but I get the error:

Error in WHERE clause near 'Arc_ID'
Unable to parse query text.

I've attached a screenshot.

The query is:
SELECT Arch_ID, Surname, Firstname, Gender, Date_of_Birth, Date_of_Death, Biography, Sources
FROM Architects
WHERE Arch_ID = ?Arch_ID
 
 http://www.pixea.net/show.php/123_error.jpg.html
sorry woogoo,
I'm not thinking straight.

It does work. I just tired 'Where Arch_ID = ?'

thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top