Newbe to SQL & MyDac

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Simon180
Posts: 3
Joined: Fri 13 Apr 2007 14:16

Newbe to SQL & MyDac

Post by Simon180 » Fri 13 Apr 2007 14:21

I need help on how to get a selected item from a database and I allso need help on getting all current IDs from a database

Code: Select all

CREATE TABLE `Users` (                                                                                                          
          `ID` int(5) NOT NULL auto_increment,                                                                                              `Name` varchar(50) NOT NULL default '',                                                                                              
          `Email` varchar(50) NOT NULL default '',                                                                                
`Password` varchar(50) NOT NULL default '',                                                                 
          `TimeStamp` varchar(10) NOT NULL default '',                                                                                              
          PRIMARY KEY  (`ID`)                                                            
        ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1     
thats my database

this is what am looking to do I want to be able to get all current registerd names and add them to a dropdown list on the sql connection then I want to be able to pull up information on each selected account from drop down can anyone help and supply a working code???

thanks alot

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 13 Apr 2007 15:35

You can retrieve all records from this table using the TMyTable component. (For the example see the Table demo that is a part of MyDAC general demo. You can find this demo in %MyDAC%\Demos\ directory. %MyDAC% is the MyDAC installation path on your computer.)
After the records are received to the client, you can display them using the standard DB-aware controls like TDBLookupListBox, TDBText, TDBEdit, TDBGrid, etc. For more information read the Delphi Help.

Post Reply