Recent

Author Topic: Can this be done with Lazarus?  (Read 6468 times)

SteveF

  • Jr. Member
  • **
  • Posts: 92
Can this be done with Lazarus?
« on: November 02, 2010, 03:49:07 pm »
Almost all of the projects I’ve built in another environment (MS Access) make full use of Access’ extensive support for importing and exporting data in various formats via Visual Basic.  Many projects will also take advantage of the fact that Access will treat data files in different formats as “native tables”, allowing me, for example, to do the following entirely within Visual Basic:

1. Link to an external dBase file using one line of code.
2. Use the data in the dBase file to update values in an Access table, using a SQL statement like “UPDATE AccessTable INNER JOIN dBaseFile ON AccessTable.Column = dBaseFile.Column SET AccessTable.OtherColumn = dbaseFile.OtherColumn WHERE dbasefile.OtherColumn = Value;”, without first importing/converting the dBase file into a native Access table.
3. Export the results of a SELECT qurey that joins the updated Access table with yet another Access table into a comma-delimited text file (with column headers) using one line of code.

I realize that Access is an environment that specializes in working with data and providing the front-end tools for doing so, while Lazarus is more generalized.  Nevertheless, are there tools/methods/tutorials available to achieve results in Lazarus similar to what I’m doing now? 

The company I work for is at least considering the idea of getting off the MS Office perpetual update merry-go-round once official support for our current version of Office expires, so I’m looking for a replacement for what I do now in Access.  The candidate I like best is Lazarus, and I know I could “roll my own” if I absolutely have to, but don’t want to re-invent the wheel if these resources have already been built.

TIA,
Steve

99Percent

  • Full Member
  • ***
  • Posts: 160
Re: Can this be done with Lazarus?
« Reply #1 on: November 02, 2010, 04:18:23 pm »
Yes, you can do all that with Lazarus, but not as simply as in Access. You will need to learn how to use database components and do vendor specific (or at the very least ODBC compliant) SQL programming, and also learn how to write reports with LazReports.

Maybe you would like to look at Open Office's Database support. It can open Access databases and do queries directly.

SteveF

  • Jr. Member
  • **
  • Posts: 92
Re: Can this be done with Lazarus?
« Reply #2 on: November 02, 2010, 07:15:56 pm »
Yes, you can do all that with Lazarus, but not as simply as in Access. You will need to learn how to use database components and do vendor specific (or at the very least ODBC compliant) SQL programming, and also learn how to write reports with LazReports.

Maybe you would like to look at Open Office's Database support. It can open Access databases and do queries directly.

OK, it's fine if it's not as simple --  I don't have that much of a problem with that.  I've been developing applications in Access and Visual Basic for over 10 years, and they're all done using VB and SQL, in both native Access & ODBC flavors -- no macros, no "lookup fields" (shudder!!). 

What would irritate me more would be to go down the not-so-simple route and find after I'm done that the simple way existed after all.  That's why I'm asking now, before I do head down that road.

So, to begin my journey, do you have any specific links to the additional things I should study?  I've already found some tutorials on connecting to and using databases, which on the whole I find a good deal easier to set up & get working than VB6. 

For instance, would you be willing to summarize the steps you would go through in Lazarus to transfer data from a CSV text file into a SQL database?  I'm not talking about specifics, more along the lines of some pseudocode steps.

TIA,
Steve

Chronos

  • Full Member
  • ***
  • Posts: 240
    • PascalClassLibrary
Re: Can this be done with Lazarus?
« Reply #3 on: November 03, 2010, 10:07:36 am »
Some FPC related database topics can be found at http://wiki.freepascal.org/Category:Databases

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: Can this be done with Lazarus?
« Reply #4 on: November 03, 2010, 01:06:05 pm »

SteveF

  • Jr. Member
  • **
  • Posts: 92
Re: Can this be done with Lazarus?
« Reply #5 on: November 03, 2010, 03:56:14 pm »
The main database page is: http://wiki.freepascal.org/Lazarus_Database_Tutorial

Getting connected to & using a SQL database is handled; I'm already doing that.  I will study the TSdfDataset section, as that looks like something I'll want to use.

Steve

 

TinyPortal © 2005-2018