MySQL .bas Module-VBForums
Results 1 to 9 of 9

Thread: MySQL .bas Module

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2009
    Posts
    11

    MySQL .bas Module

    I Made a MySQL Module File For People That Need it, So Here it is.

    Query Examples

    To Run A Mysql Query:

    vb6 Code:
    1. MySQLQuery ("SELECT * FROM people WHERE lastname = 'smith'")
    2.  
    3. lastname = rogers
    4. MySQLQuery ("UPDATE people SET lastname = 'smith' WHERE firstname = 'john'")

    Attachments:
    mod_mysql.bas
    Last edited by Nicopeo; Feb 28th, 2009 at 09:36 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,728

    Re: MySQL .bas Module

    If i were to mark the code you posted, I would give a 1 out of 10. And the 1 is for trying...

    No indentation AT ALL !
    Functions that don't return anything, make them a SUB
    Use Private/Public in general declarations of a module, NOT Dim
    Global is obsolete, use Public
    You have error labels, but On Error Resume Next , you should have "On Error GoTo errhandle"
    You are accessing a form from a Module ! Always pass Objects through sub/function parameters. What if I did not have the frmMain or Form3 ???
    You have 3 functions that do exactly the same thing !
    You are using End , always use "Unload objectname"
    The Connect function uses static LogIn, you should pass those values as parameters
    Last edited by CVMichael; Sep 8th, 2009 at 04:45 PM. Reason: spelling

  3. #3
    Member
    Join Date
    Sep 2008
    Location
    Turkey
    Posts
    37

    Re: MySQL .bas Module

    Thanks So Much

  4. #4
    Member
    Join Date
    May 2009
    Posts
    56

    Re: MySQL .bas Module

    Ok CVMichael, Can you correct and improve it ?

  5. #5
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,196

    Re: MySQL .bas Module

    Quote Originally Posted by CVMichael View Post
    If i were to mark the code you posted, I would give a 1 out of 10. And the 1 is for trying...

    No indentation AT ALL !
    Functions that don't return anything, make them a SUB
    Use Private/Public in general declarations of a module, NOT Dim
    Global is obsolete, use Public
    You have error labels, but On Error Resume Next , you should have "On Error GoTo errhandle"
    You are accessing a form from a Module ! Always pass Objects through sub/function parameters. What if I did not have the frmMain or Form3 ???
    You have 3 functions that do exactly the same thing !
    You are using End , always use "Unload objectname"
    The Connect function uses static LogIn, you should pass those values as parameters
    Also, he hasn't included any comments in his code! I reckon it would have been better if he posted a working example rather than just one bas file. Which, on its own doesn't do anything.
    Last edited by Nightwalker83; Nov 14th, 2009 at 01:45 AM. Reason: Fixing spelling
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  6. #6
    Member
    Join Date
    May 2009
    Posts
    56

    Re: MySQL .bas Module

    Ok, Can you correct and improve it ?

  7. #7
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,196

    Re: MySQL .bas Module

    Quote Originally Posted by alMubarmij View Post
    Ok, Can you correct and improve it ?
    As to the code he posted I am not sure since it has been a while since I've made anything in VB6.0. However, I could add user comments to the code tell tell people how to use the code. That is what I was talking about above.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,230

    Re: MySQL .bas Module

    Based on what CVMichael wrote, it would be a bad idea to use it, even if corrections were applied (which could take a while).

    Instead it would be better start again based on the examples in our Database Development FAQs/Tutorials (at the top of the Database Development forum)

  9. #9
    Member
    Join Date
    Sep 2008
    Location
    Turkey
    Posts
    37

    Re: MySQL .bas Module

    Thanks For share .
    Really i finding this...

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.