Re: Command sent to Access Database using OleDbDataAdapter
From: Ben de Vette (Ben.de.Vette.news1_at_profiler.nl)
Date: 05/24/04
- Previous message: Paul: "Re: "Object reference not set to an instance of an object.""
- In reply to: William Ryan eMVP: "Re: 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 22:34:07 +0200
Thanks for the clear answer.
Unfortunaltly, I already used OnRowUpdating/Updated to check for command and
values. I added all the values according to the parameters and the command
did not fail when given in Access itself.
The errormessage given is "Syntax error in UPDATE statement."
Exception thrown is "System.Data.OleDb.OleDbException"
With kind regards,
Ben de Vette
"William Ryan eMVP" <dotnetguru@comcast.nospam.net> wrote in message
news:%23C0riNcQEHA.640@TK2MSFTNGP09.phx.gbl...
> 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
> >
> >
> >
>
>
- Previous message: Paul: "Re: "Object reference not set to an instance of an object.""
- In reply to: William Ryan eMVP: "Re: 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
|