On Nov 19, 2007 9:21 AM, Mark Marsh <poco@flambe.me.uk> wrote:

I'm having a problem inserting records using ODBC. The string insert uses the length of the column that is first inserted (I'm inserting into a varchar with plenty of room) - so longer strings inserted later are truncated.

I've altered the sample binding program to demonstrate...

http://home2.btconnect.com/MarkMarsh/Binding.cpp

This happens with both postgreSQL and SQL server. Any ideas?

Mark,

You have stumbled across a problem in the ODBC connector when manually binding input parameters. This will be taken care of in the upcoming bugfix release. In the mean time, there is an easy workaround - set automatic binding for the session prior to executing:

sesion.setFeature("autoBind", true);

If you want to keep manual binding, using a vector of tuples with only one execute() (or ', now'), will do the job properly (see the Tuple sample).

If you are using 1.3.1 release archive, make sure you have patched the code:

http://sourceforge.net/tracker/index.php?func=detail&aid=1804797&group_id=132964&atid=725709
http://sourceforge.net/tracker/index.php?func=detail&aid=1803435&group_id=132964&atid=725709
http://sourceforge.net/tracker/index.php?func=detail&aid=1723148&group_id=132964&atid=725711
http://sourceforge.net/tracker/index.php?func=detail&aid=1724388&group_id=132964&atid=725711
 
You can find new features decribed in the blog, documentation and SVN repository. I do not, however, recommend SVN code for production in the next few weeks, since there were many new things introduced.

I'm assessing POCO with a view to using it to replace our current reliance on .Net which is proving to be a bit of a pain due to problems with visual studio. It looks very good so far and I hope it will prove suitable as I like the overall design very much.

Good choice ;-). Welcome to POCO community :-)

Best regards,

Alex