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

OleDB parameterized query for Access Database

bob
Hi,
Its been a long time since I have had the joy of feeding parameterized
query CommandText strings to an OleDBCommand object.
I have tried all manner of versions of " update foo set bar = @bar
where id = @id"
I have wrapped the fields in square brackets and the parameters in
square brackets and all manner of other strange variations.
The ExecuteNonQuery fires but the table doesn't update.

Finally went back to the old standby of ? as parameter place holder
and relying on Parameters ordinal position in the collection.

Is it really still this primitive or am I just screwing up the syntax?

Thanks
Bob
Jun 27 '08 #1
2 2699
On Apr 23, 11:55*pm, bob <startatbob_cl...@cutthis.adriley.co.nz>
wrote:
Hi,
Its been a long time since I have had the joy of feeding parameterized
query CommandText strings to an *OleDBCommand object.
I have tried all manner of versions of *" update foo set bar = @bar
where id = @id"
I have wrapped the fields in square brackets and the parameters in
square brackets and all manner of other strange variations.
The ExecuteNonQuery fires but the table doesn't update.

Finally went back to the old standby of ? as parameter place holder
and relying on Parameters ordinal position in the collection.

Is it really still this primitive or am I just screwing up the syntax?

Thanks
Bob
Hi,

Unfortunatelly it's :(
Jun 27 '08 #2
bob
Hi Ignacio,
Thanks for your reply.
Scott says you can actually use named parameters but yes ordinal
position must be watched. I am going to stick with the question marks
so I don't fall for the same trap again.
regards
Bob

On Thu, 24 Apr 2008 06:55:21 -0700 (PDT), "Ignacio Machin ( .NET/ C#
MVP )" <ig************@gmail.comwrote:
>On Apr 23, 11:55*pm, bob <startatbob_cl...@cutthis.adriley.co.nz>
wrote:
>Hi,
Its been a long time since I have had the joy of feeding parameterized
query CommandText strings to an *OleDBCommand object.
I have tried all manner of versions of *" update foo set bar = @bar
where id = @id"
I have wrapped the fields in square brackets and the parameters in
square brackets and all manner of other strange variations.
The ExecuteNonQuery fires but the table doesn't update.

Finally went back to the old standby of ? as parameter place holder
and relying on Parameters ordinal position in the collection.

Is it really still this primitive or am I just screwing up the syntax?

Thanks
Bob

Hi,

Unfortunatelly it's :(
Jun 27 '08 #3

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

Similar topics

1
by: gary b | last post by:
Hello When I use a PreparedStatement (in jdbc) with the following query: SELECT store_groups_id FROM store_groups WHERE store_groups_id IS NOT NULL AND type = ? ORDER BY group_name
14
by: | last post by:
Hi, I was performing SQL UPDATE queries and I notice that they SUCCEED on the ExecuteNonQuery() call with NO exceptions raised BUT they fail at the Database. They say they succeed in the code...
0
by: silesius | last post by:
I've been using VS 2003 to develop a webapplication using C#. Today I exported the application to a remote webserver I begun experiencing problems. It's a simple application that retrieves some...
2
by: VMI | last post by:
In Access, I can create a query like "select * from myTable where Name like '*Joe #*' " and it'll return records like ("Bob Joe 1", "Rick Joe 122", etc...). What's the equivalent to that in a...
11
by: anony | last post by:
Hello, I can't figure out why my parameterized query from an ASP.NET page is dropping "special" characters such as accented quotes & apostrophes, the registered trademark symbol, etc. These...
0
by: silesius | last post by:
I've been using VS.NET 2003 to develop a webapplication using C#. Today I exported the application to another webserver I begun experiencing problems. It's a simple application that retrieves...
3
by: Brian Foree | last post by:
I am developing an ASP.NET application that uses Access 2000 as its backend, and have just started getting the following error on 2 ASP.NET pages that had been working until late last week (and I...
2
by: Martin | last post by:
Hi, I currently have an application that connects to an MS ACCESS database. This application uses an OLEDB connection string for MS ACCESS. Now, I'd like to upsize the application so I converted...
8
by: Roland Hall | last post by:
In Access you use "*" + + "*", + can be replaced with & Calling a parameterized query in Access requires % be used in place of *, however, all that I have read show dynamic SQL passed to Access: ...
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.