I wrote a similar CGI program at a recent client's site using Win32::ODBC. But the driver you use is not really relevent in my mind.

First off, if you are concerned about a user inputing complete SQL statements that will be destructive, either don't let them ( however this might involve creating an interface that allows column selection then crtieria, which can be a very complex solution) or REGEX the SQL for damaging code ( check for delete, and quanantine that user if they send such SQL ) and don't allow it to execute.

You can alway revoke permissions in the database to disallow a web user from writing to the database, by giving them select rights only. If the user isn't supposed to be able to write to the database this SHOULD be in place already. Check with your DBA.

If your system uses a login, then you can disallow this AND identify someone who attmepts to submit destructive code.


In reply to Re: Bad codes for SQL by wardk
in thread Bad codes for SQL by iic

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.