Recent

Author Topic: Mysql Connection Using Lazarus Or FPC  (Read 8357 times)

Bertcito

  • New member
  • *
  • Posts: 5
Mysql Connection Using Lazarus Or FPC
« on: April 08, 2005, 03:57:22 pm »
I am a perl 5.8 and mysql 4.1 user on a pc clone running WINXP SP2.

Everything is working well.

I recently acquired a couple of pascal tutorials off the web, and I
am making an effort to learn pascal.

How do I use FPC to connect to the presently installed mysql
service which I have up and running?  

Using perl, I go thru a DBI which connects me to and passes my
queries (to mysql), and replies (from mysql).

The DBI has all of the documentation on the procedures which I
need to use to implement the above mentionred

Does pascal use a DBI?  

I have searched the Lazarus/FPC documentation for some
procedures to connect to, and query mysql. I have found
nothing concrete. What I've seen so far is quite vague,
(at least for this 70 year old dummy).

Can anyone show me a simple procedure to connect to the
mysql service using pascal. Point me to where some good
query examples can be found.

What follows, is all I need using perl to communicate with
mysql.

      use DBI;
   $db_name = "Perl_Access";
      $DSN  = "DBI:mysql:$db_name";
      $user = "perl_user";
      $pw   = "perl_pass";
      $dbh  = DBI->connect ( $DSN, $user, $pw )
        || die "Cannot connect: $DBI::errstr\n" unless $dbh;
   $dbh->{RaiseError} = 1;

I'll be most grateful to any and all help.

Thanks,
Bertcito

matthijs

  • Hero Member
  • *****
  • Posts: 537
Mysql Connection Using Lazarus Or FPC
« Reply #1 on: April 08, 2005, 04:03:13 pm »
Have you seen this page as well?
What's in a sig? Would my posting look less if it didnot have a sig? (Free after William S.) :)

:( Why cannot I upload my own Avatar? :(

Bertcito

  • New member
  • *
  • Posts: 5
Mysql Connection Using Lazarus Or FPC
« Reply #2 on: April 08, 2005, 04:23:04 pm »
Hi matthijs,

That was a very quick reply, and right to the point.

Thanks a lot for your help.

I copied the page, and I will try to learn from it.

Bertcito

 

TinyPortal © 2005-2018