Using the incredibly powerful PSI::ESP module, I think I've figured out your problem. Your last $sql variable contains placeholders, but you can't bind values by just listing them after the string! Change that to something like this:

$sql = "INSERT INTO blah (blah, blah...)" . "VALUES ($an, $ct, ...)";
which will interpolate the variables right into your VALUES clause. If any of them are strings, you'll have to put quotes around the value in the SQL string: "VALUES ('$str1', '$str2', $num)"And don't forget to Execute the resulting SQL. Right now it looks like you're just throwing the string away.

This is all guesswork, BTW ;-) Hope it helps.

Update
tilly points out that the fact that I'm interpolating the values may be mis-interpreted as saying "don't use placeholders". You can continue to use placeholders rather than interpolating -- a better idea in general. You'd have to create ADO Command and Parameters objects, then Execute them. I haven't used ADO in Perl, and I don't even know if that's supported, so I'm not going to elaborate any further. In DBI-land it would be as easy as:

$sth = $dbh->prepare($sql) or warn(...); $sth->bind_columns(\($an, $ct, ...));


In reply to Re: Undescribed problem with Win32::OLE by VSarkiss
in thread Undescribed problem with Win32::OLE by MiRaGe 508

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.