Facebook   Twitter    e-mail newsletter    YouTube    RSS Feed    Android App    iPhone and iPad App     BlackBerry App    


Results 1 to 7 of 7

Thread: Some help with Delphi?

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Location
    ZZ9 Plural Z Alpha
    Posts
    257

    Red face Some help with Delphi?

    I need some help with a project I'm working on. I need to make an information kiosk program for a hypothetical game reserve. The kiosk will display a list of 24 different bird species, and when the user clicks on a bird, information about it will be displayed.

    I have all the information about each bird stored in an Access database (with SpeciesNumber as the primary key.) When the user clicks on a bird, the program must select all the fields relating to the chosen bird from the database, and store each field as an attribute of a class.

    I can't quite figure out how to do this. I've planned to have a variable (iSpeciesNumber), which would be stored with a specific number depending on which bird button was selected. Then I imagine I would need a query component:

    "Select * from BirdsTbl where SpeciesNo = " + iSpeciesNumber

    But then I'm not sure how to store the fields into attributes. Usually when I work with SQL in Delphi, I have a DBGrid component to display the queried fields - but now I need the fields to be stored directly into a class.

    Any help would be greatly appreciated.
    Last edited by Barilak; 09-08-2012 at 08:11 PM.

  2. #2

    Default

    Retrieve the record (as a Dataset) using a TQuery component. Then move the Fields (of the Dataset) into the properties of the class.

    e.g. Bird.Colour := QueryBird.FieldByName('Colour').AsString;

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Location
    ZZ9 Plural Z Alpha
    Posts
    257

    Default

    Quote Originally Posted by rrh View Post
    Retrieve the record (as a Dataset) using a TQuery component. Then move the Fields (of the Dataset) into the properties of the class.

    e.g. Bird.Colour := QueryBird.FieldByName('Colour').AsString;
    Thanks, I'll give that a try

  4. #4
    Senior Member
    Join Date
    Apr 2012
    Location
    ZZ9 Plural Z Alpha
    Posts
    257

    Default

    It works like a charm!



    I'll be back if I have any more problems

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    ZZ9 Plural Z Alpha
    Posts
    257

    Default

    I'm back

    This one isn't really a problem per se. Does anyone know how to make a GUI designed in Delphi look better? My program is functioning properly, but it looks really "cheap." Any suggestions as to how I might make it look better? Or better yet, are there any plugins/add-on's that I can install that would enhance the GUI?

    My program makes use of two forms. It would be nice if there could be some sort of transitional effect when the program switches between forms. The program displays information on panels. I would like these panels to look more professional - something in the vein of the Windows 8 Start interface.

  6. #6

    Default

    what version of delphi are you using? the latest versions should have the office ribbon type controls, which help a bit

    unfortunately, winforms by there nature of "boring", and doing transitions, etc is not the easiest thing to do, and your frm*.pas files start to get dirty with events, etc

  7. #7
    Senior Member
    Join Date
    Apr 2012
    Location
    ZZ9 Plural Z Alpha
    Posts
    257

    Default

    I'm using Delphi 2010. I see that it does have some ribbon components. I'll look into them, thanks.

    I would prefer not to over-complicate the code, so I'll stay away from transitions for now.

Similar Threads

  1. Delphi?
    By brentm in forum Software and Web Development
    Replies: 9
    Last Post: 12-03-2012, 06:26 PM
  2. JOB: Delphi Developer
    By rpm in forum Classifieds and IT Jobs
    Replies: 0
    Last Post: 25-11-2008, 11:10 PM
  3. JOB: Delphi Developer
    By rpm in forum Classifieds and IT Jobs
    Replies: 0
    Last Post: 25-11-2008, 11:10 AM
  4. Delphi Help!
    By acidrain in forum Software and Web Development
    Replies: 86
    Last Post: 16-05-2008, 12:00 AM
  5. Delphi 7 or 8
    By rpm in forum Classifieds and IT Jobs
    Replies: 0
    Last Post: 02-02-2008, 02:10 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •