Ludibund search

Custom Search

Thursday, February 5, 2009

using input parameter in .NET with ms access database

i've tried to solve the problem about how to use input parameter when i'm using .NET and accessing MS ACCESS database (*.mdb).
for about a day, i look on internet, asked my friend, and blah...blah...
however, there is no answer...
until... enlightenment comes... the answer appears..

i don't remember the www address where i got the solution..
but it's OK..

here the answer:

instead of using @parameter as in SQLServer database, we should use question mark to mark an input parameter

example:
SQL Server 2005:
SELECT * FROM EMPLOYEES WHERE first_Name = @First name

MS Access Database through ODBC in .NET
SELECT * FROM EMPLOYEES WHERE first_Name = ?


may this post be helpful for you who's looking for this problem..


peace.. Gbu

0 comments: