For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic Database > May 2005 > VB to MySQL connection









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author VB to MySQL connection
taccea

2005-05-23, 8:58 pm

Hello, I am new to VB and MySQL connections.

I can use ether VB6 or VB.NET.

I need to make an ODBC connection to MySQL
and then I need to have the VB program poll the table
every 10 minutes.
What are some general guidles to acomplish this?

Thanks
Taccea


Veign

2005-05-24, 3:58 am

Form Template: MySQL Connection Property Form:
http://www.veign.com/vrc_codeview.asp?type=app&id=92

VB MySQL:
http://www.vbmysql.com/

Above are some samples to connect to a MySQL database using the ODBC
connector. What exact issues are you having?

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/


"taccea" <taccea@adelphia.net> wrote in message
news:XdGdnZgE4et0sw_fRVn-1w@adelphia.com...
> Hello, I am new to VB and MySQL connections.
>
> I can use ether VB6 or VB.NET.
>
> I need to make an ODBC connection to MySQL
> and then I need to have the VB program poll the table
> every 10 minutes.
> What are some general guidles to acomplish this?
>
> Thanks
> Taccea
>
>



Andrew D. Newbould

2005-05-24, 3:58 am

In message <XdGdnZgE4et0sw_fRVn-1w@adelphia.com>, taccea
<taccea@adelphia.net> writes
>Hello, I am new to VB and MySQL connections.
>
>I can use ether VB6 or VB.NET.
>
>I need to make an ODBC connection to MySQL
>and then I need to have the VB program poll the table
>every 10 minutes.
>What are some general guidles to acomplish this?
>
>Thanks
>Taccea


It really depends on what you want to do in the database every 10
minutes. However, generally you would add a timer to your Form and set
it to fire once a minute (no point firing more frequently as your going
to ignore anyway). On every 10th firing on the event you would:

1. Stop the Timer.
2. Make connection to MySQL.
3. Perform polling of required table and apply any updates.
4. Close connection to MySQL.
5. Reset counters.
6. Restart the Timer.

You would normally Stop and Start the timer just in case your polling
operations take more than 10 minutes (ie: you don't want the event to
fire again while you are in the middle of processing the previous one).

If you only want to read a table to extract something that is relevant
to your application then I would suggest using a FireHose cursor (ie:
client side, read only, forward only) for speed.

If you need to update the database during the processing then pick an
appropriate cursor.

Don't forget to and some DoEvents into your processing loop to keep
things running smoothly.

--
Andrew D. Newbould E-Mail: newsgroups@NOSPAMzadsoft.com

ZAD Software Systems Web : www.zadsoft.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com