Re: Command sent to Access Database using OleDbDataAdapter
From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 05/24/04
- Next message: Paul: "Re: "Object reference not set to an instance of an object.""
- Previous message: Jon Skeet [C# MVP]: "Re: "Object reference not set to an instance of an object.""
- In reply to: Ben de Vette: "Command sent to Access Database using OleDbDataAdapter"
- Next in thread: Ben de Vette: "Re: Command sent to Access Database using OleDbDataAdapter"
- Reply: Ben de Vette: "Re: Command sent to Access Database using OleDbDataAdapter"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 24 May 2004 15:19:28 -0400
In SQL Server you can use Profiler, but AFAIK, Access provides no similar
functionality.
You can check the Parameters collection, check the ColumnMappings to verify
the columns are mapped correctly and consequently use OnRowUpdating/Updated
to verify the values at any given time.
Those need to correspond to the ? signs. So if you had two columns where
your parameters were mapped to , Column1 and Column2 the First ? would map
to Column1 and the second to Column2. Incorrect positions are a very common
place where things go wrong.
How is it telling you that the command is failing? Are you getting a
specific exception or is it just going back and not updating anything?
If it works by when you add them by hand, I'd verify my postions b/c that's
the most likely cause. Check the column mappings as well. You may be
getting a ConcurrencyException for instance which really isn't a parameter
issue (indirectly it is b/c the parameters are causing the conflict but were
those values not already there or there but apparently changed, then it
would work). I think a routine trapping OnRowUpdating is the closest you
can get with MS Access but I'm no access expert.
http://www.knowdotnet.com/articles/efficient_pt4.html
-- W.G. Ryan, eMVP http://forums.devbuzz.com/ http://www.knowdotnet.com/williamryan.html http://www.msmvps.com/WilliamRyan/ "Ben de Vette" <Ben.de.Vette.news1@profiler.nl> wrote in message news:10b4b206frenp6e@corp.supernews.com... > Hi, > > is it possible to see the actual SQL command which is sent to Acces when > using an OleDbDataAdapter? > Al I can see now is that an update command failed. > Why, is not told. > > I already found the command string, but it is filled with the question mark > sign which still has to be filled with the parameters. I am looking for the > way to see the actual command sent. > > Because, when I replace the ?-signs (by hand) with the provided parameters > in Access itself, everything goes well. > > Thanks in advance, > Ben > > >
- Next message: Paul: "Re: "Object reference not set to an instance of an object.""
- Previous message: Jon Skeet [C# MVP]: "Re: "Object reference not set to an instance of an object.""
- In reply to: Ben de Vette: "Command sent to Access Database using OleDbDataAdapter"
- Next in thread: Ben de Vette: "Re: Command sent to Access Database using OleDbDataAdapter"
- Reply: Ben de Vette: "Re: Command sent to Access Database using OleDbDataAdapter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|