MySQL Records Demo

Coding + IDE + Code-Editor + Syntax + User-Functions + Anything else

MySQL Records Demo

Postby Henning » Sat Apr 27, 2013 11:29 pm

Hi,

Beta version out for test. :)

BEWARE!!

If unsure on how to create Users, use as.:
Set dbPassword to root Password entered when installing MySQL!


Be sure to set Public Dim Rec[10] As rsRec in Global to a sufficient number! This holds true until ReDim is working!


When entering data into textboxes, use TAB to move to next box.
Selecting any textbox and pressing Enter, will perform a search for records matching that Field.Value.
Click UPDATE DB, will try to update the Table where Table.uid = TextBox ID value.
If the Record is not found, you will be asked if you want to create a new Record.


Thats what comes to my mind right now... Please report errors or thoughts. ;)

MySQL_Records_Demo.zip
(4.09 KiB) Downloaded 95 times


/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: MySQL Records Demo

Postby Henning » Sat Apr 27, 2013 11:54 pm

Forgot to say that searches are case sensitive!

To perform case insensitive searches "=" must be changed to "LIKE" in SQL Queries.

Also forgot to say that the Database dbName If not Exists is Created without questions!

Hope you will have fun! :)

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: MySQL Records Demo

Postby Henning » Sun Apr 28, 2013 12:20 am

Forget about case sensitive... Thats why i choose VARCHAR fields... Must be age-related...

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: MySQL Records Demo

Postby Slowdown » Tue May 07, 2013 7:13 pm

Henning thank you for the demo.

It's a bit later then i expected but this evening i had some time.
When i start the demo i receive,
First.png
First.png (11.78 KiB) Viewed 1301 times

click OK and then,
second.png
second.png (11.44 KiB) Viewed 1301 times

and again click OK
thirth.png
thirth.png (10.94 KiB) Viewed 1301 times

Click Yes
Then i input some data into the fields en click 'Update the DB'
after input and update db.png
after input and update db.png (11.66 KiB) Viewed 1301 times

So something is not working as expected but is this my error :shock:
And Q7B doesn't like,
cast exception.png
cast exception.png (15.18 KiB) Viewed 1301 times

Line 74 is the 'If sDatabase Then' line (need False or True) (VB doesn't need this)
Can you kick me into the right direction ?
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: MySQL Records Demo

Postby Henning » Tue May 07, 2013 8:50 pm

It seems your dbUser or dbPassword is incorrect, or does not have rights to CREATE.

When installing MySQL you have to enter a root password, use that. Or if you have created another user, make sure priviliges are including CREATE.

Also remember to change those values in Module1 Public Sub DBConnect().

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: MySQL Records Demo

Postby Henning » Tue May 07, 2013 8:54 pm

The last error is caused by no Return is hit when sDatabase is NOT True.

Change to:
Code: Select all
Public Function GetID(iid As Integer) As Boolean
  If sDatabase Then
    strSQL = "SELECT * FROM users WHERE uid = " & iid & ";"
    If GetRec(strSQL) Then
      Return True
    Else
      Return False
    End If
  Else
     Return False
  End If
End Function


Didn't see that one comming... :o

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: MySQL Records Demo

Postby Slowdown » Wed May 08, 2013 7:15 pm

Hi Henning,
MySql is nagging me.
Is resetting the user password to YES over and over again :evil:
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: MySQL Records Demo

Postby Henning » Wed May 08, 2013 9:04 pm

:(

You may have to run the "MySQL Server Instance Config Wizard" again to get it right.

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Re: MySQL Records Demo

Postby Slowdown » Sat May 11, 2013 9:50 am

Hi Henning,

You may have to run the "MySQL Server Instance Config Wizard" again to get it right.

didn't fix my problem so did declare war to Mysql 8-)
After the thirth fresh installation it worked, solution dump user root and ad a new user.
Now have,
MySQL_1.png
MySQL_1.png (4.58 KiB) Viewed 1278 times

and
MySQL_2.png
MySQL_2.png (4.99 KiB) Viewed 1278 times

For a database with one record :D
Last edited by Slowdown on Sat May 11, 2013 1:32 pm, edited 1 time in total.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 464
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: MySQL Records Demo

Postby Henning » Sat May 11, 2013 11:36 am

At least it is running now!!

The good thing is that with 10's of databases with 100's of tables with 10000's of records it will not grow much. :)

What you have now is the DB engine and a lot of api's and helpers.

Here the running DB-engine is 52 MB...

Have you got the demo to run?

/Henning
Henning
 
Posts: 522
Joined: Fri Aug 13, 2010 6:29 pm

Next

Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 2 guests

cron