Click to See Complete Forum and Search --> : How to show certain data from MYSQL database?


farhan26
February 7th, 2006, 08:23 PM
i'm using the DataGrid to show the name of person when his ID is detected. the database located at MYSQL server. i want to show the currect person at DataGrid. (not update).just wanna show his name.using ADO and VB6.

exterminator
February 8th, 2006, 01:48 AM
For showing just one name why do you need a datagrid control. You could have done this with a single text box even.

Make a connection to the db using ADODB library objects. Execute a sql statement that would like - select lastName + ", " + firstName from Person where person_id = 123; And use the output of this (RecordSet object) select to show the name. Hope this helps. Regards.

farhan26
February 12th, 2006, 02:33 AM
thanks..but, i want to show all the students who attend the class for that day(one by one)..thats why im using DataGrid. every students who attend the class, his/her name will be appeared ata dataGrid, as their ID number is recorded. DataGrid can handle that problem?

exterminator
February 12th, 2006, 04:22 AM
This is no longer a database issue.. please visit the VB programming forum...

However, i will try answering to some extent.. Yes datagrid can handle that problem.. and when you say datagrid you should mention what datagrid - some 3rd party control etc..

Read up on msdn and look at the code samples there:
1. ADODB.Connection
2. ADODB.RecordSet
3. Connection string - www.connectionstrings.com

You may alternatively search in this forum.. I am sure you can find samples or atleast links to those samples..