On Fri, 20 Dec 2002 02:17:54 -0500 Jeff Thies <[EMAIL PROTECTED]> wrote:
> Paul Boutros wrote: > > > > > First time using Access. > > > > > > I've used my usual insert using placeholders and got an error about a > > > count mismatch. Does Access not support placeholders? > > > > It definitely does support place-holders, at least in the versions I've > > used. Can you post more info? > > I get this error: > > DBD::ADO::st execute failed: Can't execute statement 'insert into > tracking (lstord,time_stamp)values(?,?)': -2147217904: OLE exception > from "Microsoft OLE DB Provider for ODBC Drivers": > > [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect > > (there are only two fields and COUNT is not one of them) > > with this code: > > $sql=q{insert into tracking (lstord,time_stamp)values(?,?)}; > $sth=$db->prepare($sql); > $sth->execute($lstord,$time_stamp) or die "Cannot execute: > $DBI::errstr\n"; > > taking the placeholders out works: > > $sql=qq{insert into tracking > (lstord,time_stamp)values('$lstord','$time_stamp')}; > $sth=$db->prepare($sql); > $sth->execute() or die "Cannot execute: $DBI::errstr\n"; What types are lstord and time_stamp? Literals get converted automagically while placeholders do not. -- Mac :}) ** I normally forward private questions to the appropriate mail list. ** Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.