Recent

Author Topic: Quick question - DBs and Libraries  (Read 3108 times)

idealis

  • New Member
  • *
  • Posts: 34
Quick question - DBs and Libraries
« on: August 22, 2010, 05:18:50 am »
Hey there :D

A quick question about databases: Is it possible to create libraries that handle them using, for example, a Tdbf component? Because when I create a library I only get the code window, and I can't really insert components into it... Should I create a form or something?

I know this could be a rather easy question, but I don't have much experience with Lazarus or Libraries. Also, I want to use this component as an independent part of a bigger project.



Cheers! :D

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Quick question - DBs and Libraries
« Reply #1 on: August 22, 2010, 07:26:59 am »
Just create the component in code and use it in code, since it is non-visual anyway:

var
  MyDataset: TDBF;
begin
  // create the component
  MyDataset := TDBF.Create(Application);
  // now set the properties
  MyDataset.Filename := 'somefilename';
  ...

 

TinyPortal © 2005-2018