Results 1 to 5 of 5

Thread: [2.0] SQL syntactic checker

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Location
    Madrid
    Posts
    325

    [2.0] SQL syntactic checker

    Hi,
    I´d like to know if there is an easy approach as to make a Sql syntactic checker.

    Basically ensure that sql queries are syntactally correct.

    So that sb won´t try to write in,sth like:

    "Select * froma table",...

    I can only think of doing this via regular expressions. But would think this approach would be quite complicated.

    Would sb know of any .dlls which would include this type of functionality??

    Many Thanks,
    Rauland.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [2.0] SQL syntactic checker

    While it is in Classic VB (and only checks Select statements), you may find the "formatter" function I wrote useful, as it does basic validation like that.. see the link in my signature.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Location
    Madrid
    Posts
    325

    Re: [2.0] SQL syntactic checker

    Hi thanks for your reply,
    I´ve been looking at your code. It seems great, but must admit I find it difficult to understand, as I do not know much Clasic VB.

    Would approaching this same problem with regular expressions be a realistic approach?

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [2.0] SQL syntactic checker

    Regular expressions would probably be better.. but I can't really help with that, as I haven't used them enough (you can probably find pre-written ones on the web tho).

    If you want me to explain parts of my code (which I think is just string manipulation), I'm happy to do that.

  5. #5
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    Re: [2.0] SQL syntactic checker

    If it is SQL server, you could use the SQLDMO as laid out here:

    http://www.dotnetfun.com/CodeSnippet...0with%20SQLDMO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width