dataAdapter.Update() sql transactions

A

Ana Lindt

Hi,

When I try to dataAdapter.Update() I always get a "Syntax error in INSERT
INTO statement". If i take a look at the InsertCommand or cmdInsert property
of the dataAdapter, it's just fine:
"INSERT INTO NEMT_REPORTS (PLANT_ID, ACCOUNTABLE, SUBMITED, YEAR,
KPI_ENERGY, KPI_WATER, KPI_WASTEWATER, KPI_GWP, KPI_ENERGYTCOP,
KPI_ENERGYCOST) values (@PLANT_ID, @ACCOUNTABLE, @SUBMITED, @YEAR,
@KPI_ENERGY, @KPI_WATER, @KPI_WASTEWATER, @KPI_GWP, @KPI_ENERGYTCOP,
@KPI_ENERGYCOST)"

So my question is: How can I display the *real* sql command that the
dataAdapter actualy executes against the database?

Thanks for any advice,

Ana L.
 
W

William Ryan eMVP

A

Ana Lindt

Hi,

I replaced the year column in the database by 'period' and did the same
to my code, i still have the sql insert to syntax error.

The thing is that if I manualy copy paste that query and manualy replace
the @params by their values and execute it against the database, it
works.

I'm going give that sql profiler a try, I hope it works for access mdbs.

regards,

Ana L.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top