-
Feb 28th, 2009, 06:21 AM
#1
Thread Starter
New Member
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:
MySQLQuery ("SELECT * FROM people WHERE lastname = 'smith'")
lastname = rogers
MySQLQuery ("UPDATE people SET lastname = 'smith' WHERE firstname = 'john'")
Last edited by Nicopeo; Feb 28th, 2009 at 09:36 AM.
-
Feb 28th, 2009, 02:01 PM
#2
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 03:45 PM.
Reason: spelling
-
Sep 8th, 2009, 03:39 PM
#3
Member
Re: MySQL .bas Module
Thanks So Much
-
Nov 13th, 2009, 11:00 PM
#4
Member
Re: MySQL .bas Module
Ok CVMichael, Can you correct and improve it ?
-
Nov 14th, 2009, 01:43 AM
#5
Re: MySQL .bas Module
Originally Posted by CVMichael
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.
https://get.cryptobrowser.site/30/4111672
-
Nov 14th, 2009, 02:52 AM
#6
Member
Re: MySQL .bas Module
Ok, Can you correct and improve it ?
-
Nov 14th, 2009, 03:56 AM
#7
Re: MySQL .bas Module
Originally Posted by alMubarmij
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.
https://get.cryptobrowser.site/30/4111672
-
Nov 14th, 2009, 05:11 AM
#8
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)
-
Feb 25th, 2010, 12:12 PM
#9
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|