Link to home
Start Free TrialLog in
Avatar of damianb123
damianb123Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Displaying MYSQL data on form - please help!

Hi,
   I am developing an application using Visual Basic 5, I have a login form which hooks up to a MySQL database and a login form which checks the username and password, this works fine!  What I next need to do is when the main form of the program loads, I need to pull back ALL records from a different table in the database in a sort of data set - the default ADO data set with VB5 does not have MySQL listed....

Does anyone have any ideas?

Cheers
Avatar of Karen
Karen
Flag of Australia image

You will need to use a connection string, something like:

Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DRIVER={MySQL ODBC 3.51 Driver};SERVER=xxx;PORT=3306;DATABASE=xxx;OPTION=19035;"

Replace with your server and database.
Avatar of damianb123

ASKER

Thanks snowberry,
   I already have a connection string, it's just more a case of how I display the rows as seperate rows within the form?

If I do something like:

text1.text = !first_name

It displays the first name correctly, but only for the LAST record in the table.....

Can you help?
I'm not sure what you are asking. Do you want to use an ADO control or do all the connecting in the code? Do you want to move through records with a next/previous button, or have all records displayed on the one form?
All of the above :-)

I would like to be able to go previous and next with the various text boxes laid out, and also have the option of displaying all on the form.....  I know an ADO control is the best option, but I couldn't estab;ish how to use the control.

I already have a connection string, which works very well.....
ASKER CERTIFIED SOLUTION
Avatar of Karen
Karen
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you need more help with
(a) specifying which data is loaded, e.g. "I only want records where a persons name starts with the letter A"; or
(b) how to actually show it, e.g. put each bit of data onto the form so the user can see it,
then just ask. I would need to know more about what data you are showing and how you want to show it. Also info about the tables in the database that you want to read, e.g. their names and the field names that you want to load.
Perfect, tweaked a little and got what I wanted.  Thx