Solved

MySQL and FreePascal

Posted on 1998-08-18
3
788 Views
Last Modified: 2012-06-21
Hi, can some one tell me what the parameters are to connect to
a database using libmysql.a?
0
Comment
Question by:jcarlos2
3 Comments
 
LVL 2

Expert Comment

by:gravity
ID: 1025553
'frais not... but, could you help with my quest for a MySQL area in Experts Exchange by posting a new topic suggestion?

Thanks,
Tom
0
 
LVL 7

Accepted Solution

by:
jconde earned 200 total points
ID: 1025554
It's very simple JCarlos2.  All you need to do is the following:

 sock :=  mysql_connect(PMysql(@qmysql),'hostname','username','password');
  if sock=Nil then
    begin
    Writeln (stderr,'Couldn''t connect to MySQL.');
    Writeln (stderr,mysql_error(@qmysql));
    halt(1);
    end;
{Connected!}

where sock is an Integer, pmysql() is a pointer to mysql and mysql is
the structure record.

--jconde
0
 

Author Comment

by:jcarlos2
ID: 1025555
Thanks jconde

--jc
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to insert gas or chemical names in SQL server. For e.g. CO2 to CO₂. 5 77
SQL Query 34 115
use lov values 2 61
Xenapp 7 creating SQL databases using generated script 7 31
I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question