Re: [lazarus] sqldb query parameter properties not loaded?

2008-02-06 Thread John

Joost van der Sluis wrote:

Op donderdag 24-01-2008 om 20:56 uur [tijdzone +1100], schreef John:
  

Joost van der Sluis wrote:


Op donderdag 24-01-2008 om 00:09 uur [tijdzone +1100], schreef John:
  
  

Snip

It does, in so far as the parameter specs are now retained, but now the 
database property of sqlquery is not read, so it still can't work 
properly.  In fact, I can't even set the database from the Lazarus 
object inspector.



Huh? Are you sure? Did you recompile everything correclty?
  
  
You won't often catch me saying Yes I am *sure* I compiled everything 
correctly !  I think I did, though.



Quick test is to add a new writeln, see if it is triggered. If so you
have rebuild it properly.

  

This is my version of set database:



It doesn't contain a call to Inherited.SetDatabase. I think that that is
your problem now.

  

procedure TCustomSQLQuery.SetDatabase(Value : TDatabase);

var db : tsqlconnection;

begin
  if (Database  Value) then
begin
{$IFDEF DBDEBUG}
if dbdbgOn then
  Writeln(dbdbg, 'TCustomSQLQuery.database is being set to ',
 Value.DatabaseName, '.');
{$ENDIF}
if assigned(value) and not (Value is TSQLConnection) then
  DatabaseErrorFmt(SErrNotASQLConnection,[value.Name],self);



Add   '  inherited setdatabase(value);'


  

if not (csLoading in ComponentState) then
  begin
  UnPrepare;
  if assigned(FCursor) then 
TSQLConnection(DataBase).DeAllocateCursorHandle(FCursor);

  db := TSQLConnection(Value);
  if assigned(value) and (Transaction = nil) and 
(Assigned(db.Transaction)) then

transaction := Db.Transaction;
  {$IFDEF DBDEBUG}
  if dbdbgOn then
Writeln(dbdbg, 'Calling TCustomSQLQuery.OnChangeSQL because ',
   'TCustomSQLQuery.database has been set to ',
   Value.DatabaseName, '.');
  {$ENDIF}
  OnChangeSQL(Self);
  end;
end;
end;



Joost

  

YES! It works!

I was tempted to write down the details of my adventures and why it took 
so long to get to this point, but I guess that will just bore everyone.  
Suffice to say that most were about learning to use the SVN environment, 
and not much to do with the above problem.  I think I may have achieved 
a functioning SVN environment now.


So now I have the parameter query opening when the form opens, and also 
have a master/client link between two sqlqueries, without requiring 
code.  (Previously I always seemed to need an 'AfterScroll' handler to 
get it to work).


I will see what further trouble I can get into.

Thanks,
John Sunderland

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb query parameter properties not loaded?

2008-01-31 Thread Joost van der Sluis
Op donderdag 24-01-2008 om 20:56 uur [tijdzone +1100], schreef John:
 Joost van der Sluis wrote:
  Op donderdag 24-01-2008 om 00:09 uur [tijdzone +1100], schreef John:

 Snip
  It does, in so far as the parameter specs are now retained, but now the 
  database property of sqlquery is not read, so it still can't work 
  properly.  In fact, I can't even set the database from the Lazarus 
  object inspector.
  
 
  Huh? Are you sure? Did you recompile everything correclty?

 You won't often catch me saying Yes I am *sure* I compiled everything 
 correctly !  I think I did, though.

Quick test is to add a new writeln, see if it is triggered. If so you
have rebuild it properly.

 This is my version of set database:

It doesn't contain a call to Inherited.SetDatabase. I think that that is
your problem now.

 procedure TCustomSQLQuery.SetDatabase(Value : TDatabase);
 
 var db : tsqlconnection;
 
 begin
   if (Database  Value) then
 begin
 {$IFDEF DBDEBUG}
 if dbdbgOn then
   Writeln(dbdbg, 'TCustomSQLQuery.database is being set to ',
  Value.DatabaseName, '.');
 {$ENDIF}
 if assigned(value) and not (Value is TSQLConnection) then
   DatabaseErrorFmt(SErrNotASQLConnection,[value.Name],self);

Add   '  inherited setdatabase(value);'


 if not (csLoading in ComponentState) then
   begin
   UnPrepare;
   if assigned(FCursor) then 
 TSQLConnection(DataBase).DeAllocateCursorHandle(FCursor);
   db := TSQLConnection(Value);
   if assigned(value) and (Transaction = nil) and 
 (Assigned(db.Transaction)) then
 transaction := Db.Transaction;
   {$IFDEF DBDEBUG}
   if dbdbgOn then
 Writeln(dbdbg, 'Calling TCustomSQLQuery.OnChangeSQL because ',
'TCustomSQLQuery.database has been set to ',
Value.DatabaseName, '.');
   {$ENDIF}
   OnChangeSQL(Self);
   end;
 end;
 end;

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb query parameter properties not loaded?

2008-01-24 Thread John

Joost van der Sluis wrote:

Op donderdag 24-01-2008 om 00:09 uur [tijdzone +1100], schreef John:
  

Snip
It does, in so far as the parameter specs are now retained, but now the 
database property of sqlquery is not read, so it still can't work 
properly.  In fact, I can't even set the database from the Lazarus 
object inspector.



Huh? Are you sure? Did you recompile everything correclty?
  
You won't often catch me saying Yes I am *sure* I compiled everything 
correctly !  I think I did, though.


This is my version of set database:

procedure TCustomSQLQuery.SetDatabase(Value : TDatabase);

var db : tsqlconnection;

begin
 if (Database  Value) then
   begin
   {$IFDEF DBDEBUG}
   if dbdbgOn then
 Writeln(dbdbg, 'TCustomSQLQuery.database is being set to ',
Value.DatabaseName, '.');
   {$ENDIF}
   if assigned(value) and not (Value is TSQLConnection) then
 DatabaseErrorFmt(SErrNotASQLConnection,[value.Name],self);
   if not (csLoading in ComponentState) then
 begin
 UnPrepare;
 if assigned(FCursor) then 
TSQLConnection(DataBase).DeAllocateCursorHandle(FCursor);

 db := TSQLConnection(Value);
 if assigned(value) and (Transaction = nil) and 
(Assigned(db.Transaction)) then

   transaction := Db.Transaction;
 {$IFDEF DBDEBUG}
 if dbdbgOn then
   Writeln(dbdbg, 'Calling TCustomSQLQuery.OnChangeSQL because ',
  'TCustomSQLQuery.database has been set to ',
  Value.DatabaseName, '.');
 {$ENDIF}
 OnChangeSQL(Self);
 end;
   end;
end;

The bits in the {$IFDEF DBDEBUG} are what I have been using to trace the 
execution.  (Just tracing is not helpful, as I can't read the 
properties, so I can't tell where I am).  According to this, SetDatabase 
gets called once only, from inside DoFixupReferences.  At this point the 
component state indeed includes csLoading, so db never gets assigned.  
(I have also checked this with breakpoints).  This makes sense according 
to my (limited) understanding of the loader, which is that if a property 
that is being loaded is a class, it is always pushed into the fixups 
list, not set at the time.


Caveats:

I am rather behind in my svn version, 9468, compared to the one you 
generated the diff for.  Once I started adding the debug lines, I was 
reticent to update and have them all wiped out.  Also, I have had to add 
the diff in manually, as I am not sure about applying a diff to my 
working copy.


I will take just the 'if not (csLoading in ComponentState) then begin' 
(and 'end') out and see if I get the original behaviour again.


cheers,
John Sunderland

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb query parameter properties not loaded?

2008-01-23 Thread Joost van der Sluis
Op woensdag 23-01-2008 om 10:28 uur [tijdzone +1100], schreef John:
 John wrote:
  Hi,
 
  Environment: win32, Lazarus SVN 13347, fpc SVN 9468
 
  In Lazarus, I have a simple query that uses a parameter:  select * 
  from test_cld where code = :code;
  I am defining it at design time using the object inspector. I set the 
  property parameters to ftString and ptInput, save everything, and 
  close the form, and open it again.
 
  If I view the lfm source, it get:
 
 Params = item
 DataType = ftString
 Name = 'code'
 ParamType = ptInput
   end
 
  as expected, but in the object inspector, the datatype and Paramtype 
  are back to ftUnknown and ptUnknown.
 
  Further, even if I fix them and run the app, I get an error 'unknown 
  field type for parameter code', which implies that the same thing is 
  happening.  (With the correct values in the parameter I can open the 
  query at design time).
 
  I can't find any reference to this in mantis - has anyone else had the 
  problem ?
 I posted this about a month ago.  After much tracing, adding debug 
 lines, (and general chasing of wild geese,) it appears to me that the 
 following is happening:

 (So far so good)
 
 At the end of TReader.ReadData for the form, DoFixupReferences is called. 
 This sets the database to which the SQLQuery is attached by calling 
 TCustomSQLQuery.SetDatabase, which:
 Calls TCustomSQLQuery.OnChangeSQL, which:
 Calls Fparams.ParseSQL(FSQL.Text,True, ,psInterbase)
 
 However, the second parameter, true tells Fparams.ParseSQL to 
 DoCreate, which means dropping all the existing parameters and 
 recreating them from the sql text.  This means that the param field type 
 is lost, as the new parameters are created with  ftUnknown.

Can you try if the attached patch fixes this?

 (Note also that the parameters are always created as psinterbase type 
 params.  I am not sure if this causes a problem, as it may be 
 overwritten somewhere, but it looks strange as there is a 'case' in 
 ParseSQL to cover the different types of parameter styles.)

That's no problem, since the parameter style is only used to re-write
the query in a format which the db-engine understands. The call to
ParseSQL in OnChangeSQL doesn't use this result from the ParseSQL
function. (The code is runned, though. So there is room for a
optimization here)

Joost.
Index: sqldb.pp
===
--- sqldb.pp	(revision 9878)
+++ sqldb.pp	(working copy)
@@ -773,13 +773,16 @@
 begin
 if assigned(value) and not (Value is TSQLConnection) then
   DatabaseErrorFmt(SErrNotASQLConnection,[value.Name],self);
-UnPrepare;
-if assigned(FCursor) then TSQLConnection(DataBase).DeAllocateCursorHandle(FCursor);
-db := TSQLConnection(Value);
 inherited setdatabase(value);
-if assigned(value) and (Transaction = nil) and (Assigned(db.Transaction)) then
-  transaction := Db.Transaction;
-OnChangeSQL(Self);
+if not (csLoading in ComponentState) then
+  begin
+  UnPrepare;
+  if assigned(FCursor) then TSQLConnection(DataBase).DeAllocateCursorHandle(FCursor);
+  db := TSQLConnection(Value);
+  if assigned(value) and (Transaction = nil) and (Assigned(db.Transaction)) then
+transaction := Db.Transaction;
+  OnChangeSQL(Self);
+  end;
 end;
 end;
 


Re: [lazarus] sqldb query parameter properties not loaded?

2008-01-23 Thread John

Joost van der Sluis wrote:

Op woensdag 23-01-2008 om 10:28 uur [tijdzone +1100], schreef John:
  

John wrote:


Hi,

Environment: win32, Lazarus SVN 13347, fpc SVN 9468

In Lazarus, I have a simple query that uses a parameter:  select * 
from test_cld where code = :code;
I am defining it at design time using the object inspector. I set the 
property parameters to ftString and ptInput, save everything, and 
close the form, and open it again.


If I view the lfm source, it get:

   Params = item
   DataType = ftString
   Name = 'code'
   ParamType = ptInput
 end

as expected, but in the object inspector, the datatype and Paramtype 
are back to ftUnknown and ptUnknown.


Further, even if I fix them and run the app, I get an error 'unknown 
field type for parameter code', which implies that the same thing is 
happening.  (With the correct values in the parameter I can open the 
query at design time).


I can't find any reference to this in mantis - has anyone else had the 
problem ?
  
I posted this about a month ago.  After much tracing, adding debug 
lines, (and general chasing of wild geese,) it appears to me that the 
following is happening:



  

(So far so good)

At the end of TReader.ReadData for the form, DoFixupReferences is called. 
This sets the database to which the SQLQuery is attached by calling 
TCustomSQLQuery.SetDatabase, which:

Calls TCustomSQLQuery.OnChangeSQL, which:
Calls Fparams.ParseSQL(FSQL.Text,True, ,psInterbase)

However, the second parameter, true tells Fparams.ParseSQL to 
DoCreate, which means dropping all the existing parameters and 
recreating them from the sql text.  This means that the param field type 
is lost, as the new parameters are created with  ftUnknown.



Can you try if the attached patch fixes this?
  
It does, in so far as the parameter specs are now retained, but now the 
database property of sqlquery is not read, so it still can't work 
properly.  In fact, I can't even set the database from the Lazarus 
object inspector.
(Note also that the parameters are always created as psinterbase type 
params.  I am not sure if this causes a problem, as it may be 
overwritten somewhere, but it looks strange as there is a 'case' in 
ParseSQL to cover the different types of parameter styles.)



That's no problem, since the parameter style is only used to re-write
the query in a format which the db-engine understands. The call to
ParseSQL in OnChangeSQL doesn't use this result from the ParseSQL
function. (The code is runned, though. So there is room for a
optimization here)

Joost.
  


If OnChangeSql doesn't care what sort of database it is connecting to, 
why is it necessary to call OnChangeSQL to from SetDatabase even though 
the sqltext hasn't changed ?  Would it be sufficient to just unprepare 
it ?  I guess not, you still want some of the other effects of running 
OnChangeSQL.  I wondered about putting the contents of OnChangeSQL into 
another (private) function, and passing it a parameter as to whether the 
SQL had really changed (= DoCreate must be true) or not.  Then 
OnChangeSQL could call NewFunction(True) and SetDatabase could call 
NewFunction(false), and NewFunction would pass the parameter into 
DoCreate when it called Fparams.ParseSQL.  In this case, does 
SetDatabase really need the call to Fparams.ParseSQL ?


Thanks,
John Sunderland

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb query parameter properties not loaded?

2008-01-23 Thread Joost van der Sluis
Op donderdag 24-01-2008 om 00:09 uur [tijdzone +1100], schreef John:
 Joost van der Sluis wrote:
  Op woensdag 23-01-2008 om 10:28 uur [tijdzone +1100], schreef John:

  John wrote:
  
  Hi,
 
  Environment: win32, Lazarus SVN 13347, fpc SVN 9468
 
  In Lazarus, I have a simple query that uses a parameter:  select * 
  from test_cld where code = :code;
  I am defining it at design time using the object inspector. I set the 
  property parameters to ftString and ptInput, save everything, and 
  close the form, and open it again.
 
  If I view the lfm source, it get:
 
 Params = item
 DataType = ftString
 Name = 'code'
 ParamType = ptInput
   end
 
  as expected, but in the object inspector, the datatype and Paramtype 
  are back to ftUnknown and ptUnknown.
 
  Further, even if I fix them and run the app, I get an error 'unknown 
  field type for parameter code', which implies that the same thing is 
  happening.  (With the correct values in the parameter I can open the 
  query at design time).
 
  I can't find any reference to this in mantis - has anyone else had the 
  problem ?

  I posted this about a month ago.  After much tracing, adding debug 
  lines, (and general chasing of wild geese,) it appears to me that the 
  following is happening:
  
 

  (So far so good)
 
  At the end of TReader.ReadData for the form, DoFixupReferences is called. 
  This sets the database to which the SQLQuery is attached by calling 
  TCustomSQLQuery.SetDatabase, which:
  Calls TCustomSQLQuery.OnChangeSQL, which:
  Calls Fparams.ParseSQL(FSQL.Text,True, ,psInterbase)
 
  However, the second parameter, true tells Fparams.ParseSQL to 
  DoCreate, which means dropping all the existing parameters and 
  recreating them from the sql text.  This means that the param field type 
  is lost, as the new parameters are created with  ftUnknown.
  
 
  Can you try if the attached patch fixes this?

 It does, in so far as the parameter specs are now retained, but now the 
 database property of sqlquery is not read, so it still can't work 
 properly.  In fact, I can't even set the database from the Lazarus 
 object inspector.

Huh? Are you sure? Did you recompile everything correclty?

  (Note also that the parameters are always created as psinterbase type 
  params.  I am not sure if this causes a problem, as it may be 
  overwritten somewhere, but it looks strange as there is a 'case' in 
  ParseSQL to cover the different types of parameter styles.)
  
 
  That's no problem, since the parameter style is only used to re-write
  the query in a format which the db-engine understands. The call to
  ParseSQL in OnChangeSQL doesn't use this result from the ParseSQL
  function. (The code is runned, though. So there is room for a
  optimization here)
 
 If OnChangeSql doesn't care what sort of database it is connecting to, 
 why is it necessary to call OnChangeSQL to from SetDatabase even though 
 the sqltext hasn't changed ?  Would it be sufficient to just unprepare 
 it ?  I guess not, you still want some of the other effects of running 
 OnChangeSQL.  I wondered about putting the contents of OnChangeSQL into 
 another (private) function, and passing it a parameter as to whether the 
 SQL had really changed (= DoCreate must be true) or not.  Then 
 OnChangeSQL could call NewFunction(True) and SetDatabase could call 
 NewFunction(false), and NewFunction would pass the parameter into 
 DoCreate when it called Fparams.ParseSQL.  In this case, does 
 SetDatabase really need the call to Fparams.ParseSQL ?

Yes. Despite there's no difference in parameter style, there is a
difference in the ConnOptions. 

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb query parameter properties not loaded?

2008-01-22 Thread John

John wrote:

Hi,

Environment: win32, Lazarus SVN 13347, fpc SVN 9468

In Lazarus, I have a simple query that uses a parameter:  select * 
from test_cld where code = :code;
I am defining it at design time using the object inspector. I set the 
property parameters to ftString and ptInput, save everything, and 
close the form, and open it again.


If I view the lfm source, it get:

   Params = item
   DataType = ftString
   Name = 'code'
   ParamType = ptInput
 end

as expected, but in the object inspector, the datatype and Paramtype 
are back to ftUnknown and ptUnknown.


Further, even if I fix them and run the app, I get an error 'unknown 
field type for parameter code', which implies that the same thing is 
happening.  (With the correct values in the parameter I can open the 
query at design time).


I can't find any reference to this in mantis - has anyone else had the 
problem ?
I posted this about a month ago.  After much tracing, adding debug 
lines, (and general chasing of wild geese,) it appears to me that the 
following is happening:


TReader.ReadData is called for the form.  It reads the form components, 
eventually getting to SQLQuery, and reads the SQL.strings property.  At 
this point,  FParams.ParseSQL is called, which reads the SQL text and 
creates the parameters. 

The parameter properties are then read, and properties of matching 
parameters are set


(So far so good)

At the end of TReader.ReadData for the form, DoFixupReferences is called. 
This sets the database to which the SQLQuery is attached by calling 
TCustomSQLQuery.SetDatabase, which:

Calls TCustomSQLQuery.OnChangeSQL, which:
Calls Fparams.ParseSQL(FSQL.Text,True, ,psInterbase)

However, the second parameter, true tells Fparams.ParseSQL to 
DoCreate, which means dropping all the existing parameters and 
recreating them from the sql text.  This means that the param field type 
is lost, as the new parameters are created with  ftUnknown.


(Note also that the parameters are always created as psinterbase type 
params.  I am not sure if this causes a problem, as it may be 
overwritten somewhere, but it looks strange as there is a 'case' in 
ParseSQL to cover the different types of parameter styles.)


All this is likely to not be a problem if the sql and parameters are set 
at runtime, as one would typically set the database link before the sql 
text and parameters.  I was originally trying to set up a parent/child 
link at design time.


I have not put this in mantis yet, I thought someone might like to check 
my analysis - this is my first venture into the component loading code, 
and I may be on the wrong track entirely.


cheers,
John Sunderland


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-14 Thread Joost van der Sluis
Op woensdag 12-12-2007 om 20:50 uur [tijdzone +0100], schreef Michael
Van Canneyt:
 
 On Wed, 12 Dec 2007, Michael Van Canneyt wrote:
 
  
  
  On Wed, 12 Dec 2007, Graeme Geldenhuys wrote:
  
   On 12/12/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:
   
If all works as I want it, this should be reduced to 4 steps for the 
default cases,
   
   
   That is what I expected and what I was used to in Delphi.  I gather
   the change you are talking about would work from code as well, and not
   just some Lazarus Object Inspector magic?
  
  Yes, of course it would work in code as well.
  I'll see about doing this tonight.
 
 Done and committed. Sent test program to Joost.

Well, more important is: did you run the db-testsuite in fcl-db/tests
and compared the results with
http://menora.cnoc.nl/intern/testsuite.cgi?

;)

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Graeme Geldenhuys
On 12/12/2007, Swen Heinig [EMAIL PROTECTED] wrote:

 if you do step1 then step2 is automatically done (no additional work for
 you). There is the same situation for step4 and step3 (if you connect to
 the database the transaction is automatically set).


To make sure I'm not going nuts I tried it again. I redid Step 1 in a
new form. I selected the IBConnection1 in the Database property of
TSQLTransaction.  Then clicked on IBConnection1 and the link from the
TIBConnection to TSQLTransaction (Transaction property) is not setup
automatically.

Here is the code generated in the .lfm file.

  object IBConnection1: TIBConnection
left = 73
top = 17
  end
  object SQLTransaction1: TSQLTransaction
Database = IBConnection1
left = 125
top = 20
  end


I have to follow all steps mentioned in my first email otherwise I
keep getting error messages when I try and set the database components
active.

I got a Lazarus svn update this morning. I'm using r13293.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Swen Heinig
Hello Graeme,

if you do step1 then step2 is automatically done (no additional work for
you). There is the same situation for step4 and step3 (if you connect to
the database the transaction is automatically set). Step5b: You can
connect the SQLQuery to a second Datasource. If you connect the
components in the right order you will not get surprises.

Regards,
Swen


Graeme Geldenhuys schrieb:
 Hi,

 Please bare with me Lets get one thing out of the way. I never use
 DB Connection components on Forms and never use DB-aware components.
 I'm a OPF guy, so using the database components on a day-to-day basis
 is not something I am familiar with.

 So that said, I thought I would play with the SqlDB components today
 because I want to complete the SqlDB persistence layer for tiOPF.

 The ingredients I used for today are:
   TIBConnection, TSQLTransaction, TSQLQuery, TDataSource and TDBGrid.

 I got everything to work and data to be displayed in the TDBGrid, but
 here is where the 'madness' part comes in.  The _very strange_ way I
 had to connect the above components.

 Step 1:
 ==
 TIBConnection   -   TSQLTransaction  via  'Database' property. No problem 
 here.

 Step 2:
 ==
 TIBConnection  -  TSQLTransaction  via 'Transaction' property.
 Why???  Why must you link components in both directions?

 Step 3:
 ==
 TSQLTransaction   -  TSQLQuery via 'Transaction' property. No problems here.

 Step 4:
 ==
 TIBConnection   -  TSQLQuery via 'Database' property. Why???  Can't
 it figure it out from the TSQLTransaction it's hooked up to already
 (step 3)?  What happens if the Transaction component is hooked up to
 DB1 and then I specify DB2 in the Database property?

 Step 5a:
 ==
 TSQLQuery   -   TDatasource via the 'Dataset' property.  No problems here.

 Step 5b: (optional)
 ==
 TSQLQuery  -  TDatasource via the 'DataSource' property.  It can be
 done, but wasn't needed to get my example project to work. Not sure
 what's the rules about this one.

 Step 6:
 ==
 TDBGrid   -  TDatasource via the 'DataSource' property.  No problems here.



 So if you haven't figured it out, my issues are with steps 2, 4  5b.
 I really can't see why they are needed in the first place. Linking
 components in both directions are simply redundant.  Has nobody
 thought this as strange?

 It's like dropping a PopupMenu on a Form and then setting the
 following (which isn't needed by the way).   Form.PopupMenu :=
 PopupMenu. PopupMenu.Control := Form

 I worked with Delphi 7 using BDE and DOA (Direct Oracle Access) and
 never had to set links between database components in both directions.



 Below is the code generated in the .lfm file if the above wasn't clear.

 ---[  Copy  ]
   object IBConnection1: TIBConnection
 Connected = True
 Streamedconnected = True
 DatabaseName = 'm2'
 Password = 'masterkey'
 Transaction = SQLTransaction1
 UserName = 'sysdba'
 HostName = '192.168.0.1'
 Dialect = 3
 left = 40
 top = 8
   end
   object SQLTransaction1: TSQLTransaction
 Active = True
 Database = IBConnection1
 left = 78
 top = 8
   end
   object SQLQuery1: TSQLQuery
 Active = True
 Database = IBConnection1
 Transaction = SQLTransaction1
 SQL.Strings = (
   'select * from Users'
 )
 Params = 
 UpdateMode = upWhereKeyOnly
 UsePrimaryKeyAsKey = True
 ParseSQL = True
 left = 118
 top = 8
   end
   object Datasource1: TDatasource
 DataSet = SQLQuery1
 left = 78
 top = 48
   end
 ---[  End  ]



 Regards,
   - Graeme -


 ___
 fpGUI - a cross-platform Free Pascal GUI toolkit
 http://opensoft.homeip.net/fpgui/

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives


   

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Swen Heinig
Sorry, there was a misunderstanding from my side. If you do step2 then
step1 is automatically done (thats the correct way).

Swen


Graeme Geldenhuys schrieb:
 On 12/12/2007, Swen Heinig [EMAIL PROTECTED] wrote:
   
 if you do step1 then step2 is automatically done (no additional work for
 you). There is the same situation for step4 and step3 (if you connect to
 the database the transaction is automatically set).
 


 To make sure I'm not going nuts I tried it again. I redid Step 1 in a
 new form. I selected the IBConnection1 in the Database property of
 TSQLTransaction.  Then clicked on IBConnection1 and the link from the
 TIBConnection to TSQLTransaction (Transaction property) is not setup
 automatically.

 Here is the code generated in the .lfm file.

   object IBConnection1: TIBConnection
 left = 73
 top = 17
   end
   object SQLTransaction1: TSQLTransaction
 Database = IBConnection1
 left = 125
 top = 20
   end


 I have to follow all steps mentioned in my first email otherwise I
 keep getting error messages when I try and set the database components
 active.

 I got a Lazarus svn update this morning. I'm using r13293.


 Regards,
   - Graeme -


 ___
 fpGUI - a cross-platform Free Pascal GUI toolkit
 http://opensoft.homeip.net/fpgui/

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives


   


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Joost van der Sluis
Op woensdag 12-12-2007 om 15:11 uur [tijdzone +0200], schreef Graeme
Geldenhuys:
 
 Step 1:
 ==
 TIBConnection   -   TSQLTransaction  via  'Database' property. No problem 
 here.
 
 Step 2:
 ==
 TIBConnection  -  TSQLTransaction  via 'Transaction' property.
 Why???  Why must you link components in both directions?

You don't need to do this. It is used when the TIBConnection tries to
execute some sql-statements itself. If has to know which transaction it
should use. You have to see this as the 'default transaction'. If you do
TIBConnection.ExecuteDirect, this transaction is used. This transaction
is also used when you use ApplyUpdates.

 Step 3:
 ==
 TSQLTransaction   -  TSQLQuery via 'Transaction' property. No problems here.
 
 Step 4:
 ==
 TIBConnection   -  TSQLQuery via 'Database' property. Why???  Can't
 it figure it out from the TSQLTransaction it's hooked up to already
 (step 3)?  What happens if the Transaction component is hooked up to
 DB1 and then I specify DB2 in the Database property?

Hm.. I never thought about that, really. It could be usefull, though.
For example Oracle supports transactions which are working on several
groups of databases Not that this is supported by sqldb...

Michael, would it be an idea to remove this link?

 Step 5a:
 ==
 TSQLQuery   -   TDatasource via the 'Dataset' property.  No problems here.
 
 Step 5b: (optional)
 ==
 TSQLQuery  -  TDatasource via the 'DataSource' property.  It can be
 done, but wasn't needed to get my example project to work. Not sure
 what's the rules about this one.

I've been mistaken about this one more then once. Also my collegues had
problems with this.
iirc it's renamed to something else in recent versions. What it does is
handling the master-detail relationships. 

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Graeme Geldenhuys
On 12/12/2007, Joost van der Sluis [EMAIL PROTECTED] wrote:

  Step 2:
 You don't need to do this. It is used when the TIBConnection tries to
 execute some sql-statements itself. If has to know which transaction it
 should use. You have to see this as the 'default transaction'. If you do
 TIBConnection.ExecuteDirect, this transaction is used. This transaction
 is also used when you use ApplyUpdates.


snip

  Step 5b: (optional)
  ==
  TSQLQuery  -  TDatasource via the 'DataSource' property.  It can be
  done, but wasn't needed to get my example project to work. Not sure
  what's the rules about this one.

 I've been mistaken about this one more then once. Also my collegues had
 problems with this.
 iirc it's renamed to something else in recent versions. What it does is
 handling the master-detail relationships.


I have to beg to differ on both counts!  They are both required, see below.

I could send you my project if it might help.


As for Step 5. Well in my simple example I have a query: Select * from users.
No master-detail relationship there! Yet if I try to set the
TSQLQuery.Active = True I get a Database not assigned! error.
Assign the Database property to IBConnection1 and try Active = True again.

This time I get the following error:  Transaction of connection not
set.  Now I go to the IBConnection1 and set the Transaction (doubly
link madness) and no I'm not trying to execute anything directly via
the IBConnection.  Go back to SQLQuery and set Active = True.  Now
everything works and I get results in the DBGrid.

So bottom line - all the steps from my first email *are* required to
get results in a DBGrid.



Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Michael Van Canneyt


On Wed, 12 Dec 2007, Joost van der Sluis wrote:

 Op woensdag 12-12-2007 om 15:11 uur [tijdzone +0200], schreef Graeme
 Geldenhuys:
  
  Step 1:
  ==
  TIBConnection   -   TSQLTransaction  via  'Database' property. No problem 
  here.
  
  Step 2:
  ==
  TIBConnection  -  TSQLTransaction  via 'Transaction' property.
  Why???  Why must you link components in both directions?
 
 You don't need to do this. It is used when the TIBConnection tries to
 execute some sql-statements itself. If has to know which transaction it
 should use. You have to see this as the 'default transaction'. If you do
 TIBConnection.ExecuteDirect, this transaction is used. This transaction
 is also used when you use ApplyUpdates.

1. It should be set to the first transaction that is hooked up to it.
   That's what IBX does, and it makes sense. So you don't need to set it.

2. ApplyUpdates should use the transaction of TSQLQuery ?

 
  Step 3:
  ==
  TSQLTransaction   -  TSQLQuery via 'Transaction' property. No problems 
  here.
  
  Step 4:
  ==
  TIBConnection   -  TSQLQuery via 'Database' property. Why???  Can't
  it figure it out from the TSQLTransaction it's hooked up to already
  (step 3)?  What happens if the Transaction component is hooked up to
  DB1 and then I specify DB2 in the Database property?
 
 Hm.. I never thought about that, really. It could be usefull, though.
 For example Oracle supports transactions which are working on several
 groups of databases Not that this is supported by sqldb...
 
 Michael, would it be an idea to remove this link?

No, because Firebird and Oracle support cross-database transactions, and you
must point out the correct database. 

But, setting TSQLQuery.Transaction should set Database if it is not yet set,
and vice versa, setting TSQLQuery.Database should set TRansaction to 
Database.Defaulttransaction.

This is on my TODO list before 2.2.2, because I consider this a bug.

 
  Step 5a:
  ==
  TSQLQuery   -   TDatasource via the 'Dataset' property.  No problems here.
  
  Step 5b: (optional)
  ==
  TSQLQuery  -  TDatasource via the 'DataSource' property.  It can be
  done, but wasn't needed to get my example project to work. Not sure
  what's the rules about this one.
 
 I've been mistaken about this one more then once. Also my collegues had
 problems with this.
 iirc it's renamed to something else in recent versions. What it does is
 handling the master-detail relationships. 

It is not renamed, and it should not be. In Delphi it is also called DataSource.

As Joost says, it is needed to handle Master-Detail relations:

Query1:
   Select ID, * from Invoice 
DS1.Dataset=Query1;

Query2:
  Select * from InvoiceDetails Where InvoiceID=:ID;
Query2.DataSource:=DS1;

As the user scrolls through Query1, Query2 is updated automatically with the 
new ID value.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Michael Van Canneyt


On Wed, 12 Dec 2007, Graeme Geldenhuys wrote:

 On 12/12/2007, Joost van der Sluis [EMAIL PROTECTED] wrote:
 
   Step 2:
  You don't need to do this. It is used when the TIBConnection tries to
  execute some sql-statements itself. If has to know which transaction it
  should use. You have to see this as the 'default transaction'. If you do
  TIBConnection.ExecuteDirect, this transaction is used. This transaction
  is also used when you use ApplyUpdates.
 
 
 snip
 
   Step 5b: (optional)
   ==
   TSQLQuery  -  TDatasource via the 'DataSource' property.  It can be
   done, but wasn't needed to get my example project to work. Not sure
   what's the rules about this one.
 
  I've been mistaken about this one more then once. Also my collegues had
  problems with this.
  iirc it's renamed to something else in recent versions. What it does is
  handling the master-detail relationships.
 
 
 I have to beg to differ on both counts!  They are both required, see below.
 
 I could send you my project if it might help.
 
 
 As for Step 5. Well in my simple example I have a query: Select * from 
 users.
 No master-detail relationship there! Yet if I try to set the
 TSQLQuery.Active = True I get a Database not assigned! error.
 Assign the Database property to IBConnection1 and try Active = True again.
 
 This time I get the following error:  Transaction of connection not
 set.  Now I go to the IBConnection1 and set the Transaction (doubly
 link madness) and no I'm not trying to execute anything directly via
 the IBConnection.  Go back to SQLQuery and set Active = True.  Now
 everything works and I get results in the DBGrid.
 
 So bottom line - all the steps from my first email *are* required to
 get results in a DBGrid.

In that case you represented step 5 wrongly: There you need 
DataSource.Dataset - TSQLQuery.

In short, assume the following components:

DB : TSQLConnection descendent.
TR : TSQLTransaction;
Q : TSQLQuery;
DS : TDataSource;
G : TDBGrid;

Then these are the steps:

1. TR.Database - DB
2. DB.DefaultTransaction - TR // Should be automatic in future.
3. Q.Transaction - TR
4. Q.Database-DB // Should be automatic in future.
5. DS.Dataset-Q;
6. G.DataSource-DS;

If all works as I want it, this should be reduced to 4 steps for the default 
cases,
and steps 1 and 2 can be reversed if so desired, and steps 3 and 4 also.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Graeme Geldenhuys
On 12/12/2007, Joost van der Sluis [EMAIL PROTECTED] wrote:

 Both counts? 5b Is optional? You said that yourself.

Sorry, I got Step 4 and 5 mixed up.

 That's because you don't have any indexes pre-defined. So it tries to
 fetch the indexes from the database. At that point the TIBConnection
 needs a transaction... Set TSQLQuery.ParseSQL:=false; Then you don't

So in addition to my Select statement, it executes another auto
generated query trying to look for a Index.  That's interesting.

 need step 2 anymore. For your OPF you have to set it to false anyways,
 since it's useless in your case.

Thanks for the tip.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Graeme Geldenhuys
On 12/12/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:

 If all works as I want it, this should be reduced to 4 steps for the default 
 cases,


That is what I expected and what I was used to in Delphi.  I gather
the change you are talking about would work from code as well, and not
just some Lazarus Object Inspector magic?


PS:
Would anybody mind if I put this new found knowledge in a fpdoc sqldb
file?  It would be nice having some help as a start, compared to
nothing as it stands at the moment.  It can always be improved on or
completed at a later date by other contributors.  I remember just a
few days ago there were other developers also complaining about not
having any help reference for the sqldb units. My contributions would
at least be a start.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Michael Van Canneyt


On Wed, 12 Dec 2007, Graeme Geldenhuys wrote:

 On 12/12/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:
 
  If all works as I want it, this should be reduced to 4 steps for the 
  default cases,
 
 
 That is what I expected and what I was used to in Delphi.  I gather
 the change you are talking about would work from code as well, and not
 just some Lazarus Object Inspector magic?

Yes, of course it would work in code as well.
I'll see about doing this tonight.

 PS:
 Would anybody mind if I put this new found knowledge in a fpdoc sqldb
 file?  It would be nice having some help as a start, compared to
 nothing as it stands at the moment.  It can always be improved on or
 completed at a later date by other contributors.  I remember just a
 few days ago there were other developers also complaining about not
 having any help reference for the sqldb units. My contributions would
 at least be a start.

Please do.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Michael Van Canneyt


On Wed, 12 Dec 2007, Michael Van Canneyt wrote:

 
 
 On Wed, 12 Dec 2007, Graeme Geldenhuys wrote:
 
  On 12/12/2007, Michael Van Canneyt [EMAIL PROTECTED] wrote:
  
   If all works as I want it, this should be reduced to 4 steps for the 
   default cases,
  
  
  That is what I expected and what I was used to in Delphi.  I gather
  the change you are talking about would work from code as well, and not
  just some Lazarus Object Inspector magic?
 
 Yes, of course it would work in code as well.
 I'll see about doing this tonight.

Done and committed. Sent test program to Joost.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB component madness

2007-12-12 Thread Graeme Geldenhuys
On 13/12/2007, John [EMAIL PROTECTED] wrote:
 I did put some stuff in the wiki:
 http://wiki.freepascal.org/SQLdb_Package.  Perhaps that doesn't count.
 Certainly it could be improved.

I'll have a look there thanks, but I was actually referring to the
class documentation created by fpdoc. So when I press F1 in Lazarus
I'll find some help on a class or method.


Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Alvise Nicoletti

Henry Vermaak ha scritto:

On 17/10/2007, Alvise Nicoletti [EMAIL PROTECTED] wrote:
  

Hi...

I tryed to compile my linux service for a server with ubuntu 64 bit and
mysql 5.
So I changed in the code every mysql40 reference to mysql50.
I tryed to change target, compile, and copy the binary to the another
server, when I try to connect to the database all I get is:
Can not load MySQL library libmysqlclient.so. Please check your
installation.

The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).

I need an application that works on this kind of server, so if you
suspect that I can have any trouble with this in the future please
notify it to me. I'm a little scared about that.
Is it just a misconfiguration problem?

If I do a locate libmysqlclient.so I found:
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0




you will need to install the -dev package (which will make the
libmysqlclient.so link).

henry

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



  

Thank you for your support.

I installed the package on the machine I'm copyng the compiled binary 
and I have the same error: Can not load MySQL library 
libmysqlclient.so. Please check your installation.

Really... I installed another package cause:
# apt-get install mysql-dev
The package mysql-dev don't have avaiable versions, but is nominated in 
another package, so it's obsolete or missing.

However, this package replaces it:
libmysqlclient12-dev libmysqlclient10-dev

So I choosed libmysqlclient12-dev and installed it.

But I still have the same error.

I also did a updatedb and locate libmysqlclient.so and I find:
/usr/lib/libmysqlclient.so
/usr/lib/libmysqlclient.so.12
/usr/lib/libmysqlclient.so.12.0.0
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0

# ls -al /usr/lib/libmysqlclient.so
lrwxrwxrwx 1 root root 20 2007-10-18 09:36 /usr/lib/libmysqlclient.so - 
libmysqlclient.so.12


Is there something else I have to do?

Does I need to do that also on the machine that is COMPILING the 
program? (in that 32 bit machine, the program, always worked... I'm only 
having problems to run the program on another (64 bits) machine).


Thank you in advance.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Joost van der Sluis
Op woensdag 17-10-2007 om 18:03 uur [tijdzone +0200], schreef Alvise
Nicoletti:

 I tryed to compile my linux service for a server with ubuntu 64 bit and 
 mysql 5.
 So I changed in the code every mysql40 reference to mysql50.
 I tryed to change target, compile, and copy the binary to the another 
 server, when I try to connect to the database all I get is:
 Can not load MySQL library libmysqlclient.so. Please check your 
 installation.
 
 The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).
 
 I need an application that works on this kind of server, so if you 
 suspect that I can have any trouble with this in the future please 
 notify it to me. I'm a little scared about that.
 Is it just a misconfiguration problem?
 
 If I do a locate libmysqlclient.so I found:
 /usr/lib/libmysqlclient.so.15
 /usr/lib/libmysqlclient.so.15.0.0

You have to install the 64-bit version of the mysql-client. On most
distributions, that's located in /usr/lib64/ and not /usr/lib.

So take a look in /usr/lib64 It's most probable that the correct link is
missing there. (The usual mysql-library-link-issues)

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Alvise Nicoletti

Joost van der Sluis ha scritto:

Op woensdag 17-10-2007 om 18:03 uur [tijdzone +0200], schreef Alvise
Nicoletti:

  
I tryed to compile my linux service for a server with ubuntu 64 bit and 
mysql 5.

So I changed in the code every mysql40 reference to mysql50.
I tryed to change target, compile, and copy the binary to the another 
server, when I try to connect to the database all I get is:
Can not load MySQL library libmysqlclient.so. Please check your 
installation.


The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).

I need an application that works on this kind of server, so if you 
suspect that I can have any trouble with this in the future please 
notify it to me. I'm a little scared about that.

Is it just a misconfiguration problem?

If I do a locate libmysqlclient.so I found:
/usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient.so.15.0.0



You have to install the 64-bit version of the mysql-client. On most
distributions, that's located in /usr/lib64/ and not /usr/lib.

So take a look in /usr/lib64 It's most probable that the correct link is
missing there. (The usual mysql-library-link-issues)
  

I don't know if I'm wrong... but...:
# ls -al /usr/
drwxr-xr-x  88 root root 20480 2007-10-18 09:36 lib
drwxr-xr-x   4 root root  4096 2007-07-18 12:13 lib32
lrwxrwxrwx   1 root root 3 2007-07-17 16:37 lib64 - lib

So, if lib64 is just a link to lib... it should work anyway, right?

I can also do a:
# ls -al /usr/lib64/libmysqlclient.so
lrwxrwxrwx 1 root root 20 2007-10-18 09:36 /usr/lib64/libmysqlclient.so 
- libmysqlclient.so.12


Finding the correct library in the correct place...

Alvise

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



  


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-18 Thread Joost van der Sluis
Op donderdag 18-10-2007 om 11:32 uur [tijdzone +0200], schreef Alvise
Nicoletti:
 Joost van der Sluis ha scritto:
  Op woensdag 17-10-2007 om 18:03 uur [tijdzone +0200], schreef Alvise
  Nicoletti:
 

  I tryed to compile my linux service for a server with ubuntu 64 bit and 
  mysql 5.
  So I changed in the code every mysql40 reference to mysql50.
  I tryed to change target, compile, and copy the binary to the another 
  server, when I try to connect to the database all I get is:
  Can not load MySQL library libmysqlclient.so. Please check your 
  installation.
 
  The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).
 
  I need an application that works on this kind of server, so if you 
  suspect that I can have any trouble with this in the future please 
  notify it to me. I'm a little scared about that.
  Is it just a misconfiguration problem?
 
  If I do a locate libmysqlclient.so I found:
  /usr/lib/libmysqlclient.so.15
  /usr/lib/libmysqlclient.so.15.0.0
  
 
  You have to install the 64-bit version of the mysql-client. On most
  distributions, that's located in /usr/lib64/ and not /usr/lib.
 
  So take a look in /usr/lib64 It's most probable that the correct link is
  missing there. (The usual mysql-library-link-issues)

 I don't know if I'm wrong... but...:
 # ls -al /usr/
 drwxr-xr-x  88 root root 20480 2007-10-18 09:36 lib
 drwxr-xr-x   4 root root  4096 2007-07-18 12:13 lib32
 lrwxrwxrwx   1 root root 3 2007-07-17 16:37 lib64 - lib
 
 So, if lib64 is just a link to lib... it should work anyway, right?

Yes, but that's not how the distribution I use has solved it.

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : program crash using more than 9-10 fieldsets: bug...?

2007-10-18 Thread Joost van der Sluis
Op donderdag 18-10-2007 om 11:23 uur [tijdzone +0200], schreef Alvise
Nicoletti:
 This is a bug notification... I managed to re-create the segmentation 
 fault bug.
 
 The service was crashing without giving any output and any reason, the 
 problem was in the NUMBER of the parameters in the result set fetched in 
 the select:
 10.
 
 Fetching less parameters (9), all works. You can add and remove any kind 
 of parameter, not one in particular to force the crash.

Oh, yes, I knew that. That's fixed in fpc 2.3.1. I'll merge the fix to
fpc 2.2.1.

 A strange thing is that if I set parseSQL to true, I get a mysql syntax 
 error before the crash of the application:
 Check the manual that corresponds to your MySQL server version for the 
 right syntax to use near 'GROUP BY i.pk_iscrizione, i.n_ingressi, 
 t.nome, a.nome, a.tipo_

Well, please first update to at least fpc 2.2.0.

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-17 Thread Alvise Nicoletti

Sorry if I bother you... but I still have to understand:
- if the component don't allows to do that kind of query (to get a 
last_insert_id)

- if i'm doing something wrong
- if there is a bug somewere

Also, now I have a new problem... A big query I do (the smaller ones 
works...) works only the first time I do it.
The second time, the program goes in segmentation fault if the 
query.ParseSQL is false.
If ParseSQL is true, i get a sql error, but copying and pasting the same 
query into a mysql client the query works perfectly (it's the same I 
did  the first time and worked).


What can I do?

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-17 Thread Henry Vermaak
On 17/10/2007, Alvise Nicoletti [EMAIL PROTECTED] wrote:
 Hi...

 I tryed to compile my linux service for a server with ubuntu 64 bit and
 mysql 5.
 So I changed in the code every mysql40 reference to mysql50.
 I tryed to change target, compile, and copy the binary to the another
 server, when I try to connect to the database all I get is:
 Can not load MySQL library libmysqlclient.so. Please check your
 installation.

 The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).

 I need an application that works on this kind of server, so if you
 suspect that I can have any trouble with this in the future please
 notify it to me. I'm a little scared about that.
 Is it just a misconfiguration problem?

 If I do a locate libmysqlclient.so I found:
 /usr/lib/libmysqlclient.so.15
 /usr/lib/libmysqlclient.so.15.0.0


you will need to install the -dev package (which will make the
libmysqlclient.so link).

henry

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-17 Thread Henry Vermaak
On 17/10/2007, Henry Vermaak [EMAIL PROTECTED] wrote:

 you will need to install the -dev package (which will make the
 libmysqlclient.so link).

although that should only be necessary for linking.  hmm.  sorry.


 henry


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb and 64 bits

2007-10-17 Thread Michael Van Canneyt


On Wed, 17 Oct 2007, Alvise Nicoletti wrote:

 Hi...
 
 I tryed to compile my linux service for a server with ubuntu 64 bit and mysql
 5.
 So I changed in the code every mysql40 reference to mysql50.
 I tryed to change target, compile, and copy the binary to the another server,
 when I try to connect to the database all I get is:
 Can not load MySQL library libmysqlclient.so. Please check your
 installation.
 
 The server configuration is ubuntu 64 bit, mysql 5.0 (client and server).
 
 I need an application that works on this kind of server, so if you suspect
 that I can have any trouble with this in the future please notify it to me.
 I'm a little scared about that.
 Is it just a misconfiguration problem?

It probably is.

You can see what the program does by doing a
strace -o log.txt yourprogram

after the program exits, examine the log.txt file, and search for
libmysqlclient.so
note the paths that it is trying to find the file.

This may give you a hint about the problem.

Michael.


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-16 Thread Alvise Nicoletti

John ha scritto:

Alvise Nicoletti wrote:
Hi... this is the complete code I'm using to extract the 
last_insert_id from the table TABLE1, but it still don't works.
Infact I get always 0 from the variable id_ingresso, pheraphs in 
the database the row is correctly inserted.



Hi Alvise,

I haven't gone through you example completely, but try doing the same
thing by generating the sql text on the fly instead of using
parameters.  I was unable to get anything to work using parameters when
I last tried a few months ago.

cheers,
John

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives



I tryed but that wasn't the problem... With delphi+zeoslib the (nearly) 
same code works, so I suppose I found some kind of bug...

How can I debug this?

I tryed, as you see in the code, to handle the transaction like if it's 
only one block of operations...
... Maybe there is an implicit commit after the query execution that I 
don't know how to remove?


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-16 Thread Joost van der Sluis
Op dinsdag 16-10-2007 om 10:45 uur [tijdzone +0200], schreef Alvise
Nicoletti:
 John ha scritto:
  Alvise Nicoletti wrote:
  Hi... this is the complete code I'm using to extract the 
  last_insert_id from the table TABLE1, but it still don't works.
  Infact I get always 0 from the variable id_ingresso, pheraphs in 
  the database the row is correctly inserted.
 
  Hi Alvise,
 
  I haven't gone through you example completely, but try doing the same
  thing by generating the sql text on the fly instead of using
  parameters.  I was unable to get anything to work using parameters when
  I last tried a few months ago.
 
  cheers,
  John
 
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
 
 
 
 I tryed but that wasn't the problem... With delphi+zeoslib the (nearly) 
 same code works, so I suppose I found some kind of bug...
 How can I debug this?

Compile fcl-db with debuginfo. If you use Lazarus, you can simply add
fpcsrc/packages/fcl-db/sqldb and fpcsrc/packages/fcl-db/sqldb/mysql to
your project-sources path.

Or you can do a 'make clean all OPT='-gl' install' in
fpcsrc/packages/fcl-db. But then you have to take care that the
generated .ppu files are installed into the right paths. (On windows
this is mostly not the case)

 I tryed, as you see in the code, to handle the transaction like if it's 
 only one block of operations...
 ... Maybe there is an implicit commit after the query execution that I 
 don't know how to remove?

I haven't debugged your code yet, but sqldb doesn't support transactions
at all for mysql (As mysql  5 doesn't do so either) So it  doesn't do
any commits. As you've set parsesql to false, it also doesn't do any
extra queries, do I think it should work.

For a real solution you should have take a look at
http://www.freepascal.org/mantis/view.php?id=9758

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-16 Thread Alvise Nicoletti

Joost van der Sluis ha scritto:

Op dinsdag 16-10-2007 om 10:45 uur [tijdzone +0200], schreef Alvise
Nicoletti:
  

John ha scritto:


Alvise Nicoletti wrote:
  
Hi... this is the complete code I'm using to extract the 
last_insert_id from the table TABLE1, but it still don't works.
Infact I get always 0 from the variable id_ingresso, pheraphs in 
the database the row is correctly inserted.




Hi Alvise,

I haven't gone through you example completely, but try doing the same
thing by generating the sql text on the fly instead of using
parameters.  I was unable to get anything to work using parameters when
I last tried a few months ago.

cheers,
John

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives



  
I tryed but that wasn't the problem... With delphi+zeoslib the (nearly) 
same code works, so I suppose I found some kind of bug...

How can I debug this?



Compile fcl-db with debuginfo. If you use Lazarus, you can simply add
fpcsrc/packages/fcl-db/sqldb and fpcsrc/packages/fcl-db/sqldb/mysql to
your project-sources path.

Or you can do a 'make clean all OPT='-gl' install' in
fpcsrc/packages/fcl-db. But then you have to take care that the
generated .ppu files are installed into the right paths. (On windows
this is mostly not the case)
  


Sorry but debug is a little hard for me... the program is a linux 
service and I never debugged it, when I have a problem I just put some 
text-file-logging around in the code.
  
I tryed, as you see in the code, to handle the transaction like if it's 
only one block of operations...
... Maybe there is an implicit commit after the query execution that I 
don't know how to remove?



I haven't debugged your code yet, but sqldb doesn't support transactions
at all for mysql (As mysql  5 doesn't do so either) So it  doesn't do
any commits. As you've set parsesql to false, it also doesn't do any
extra queries, do I think it should work.

For a real solution you should have take a look at
http://www.freepascal.org/mantis/view.php?id=9758
  

Ok, so the auto-commit can't be the problem cause I'm using mysql 4.0.20.

I read the bugtracker at the link... Just for completion, I write you 
that the linux-service I'm doing have several threads inside it, however 
actually the class it's using it it's not used by a thread but by a 
class (a tcp/ip device that generates query events when send/receive 
something).


Just to say... actually with  your component I'm doing 7 queryes each 
one of 5-10 rows involving 5 to 8 tables in 37 milliseconds (amazing).

And the mysql server is not localhost.

So it seems to work VERY well; I just have a problem with that damn 
last_insert_id.


If you have other ideas (after you look at the code) or if you need some 
more code, just write me.


Thanks again,
Alvise


Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



  


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-15 Thread Alvise Nicoletti
Hi... this is the complete code I'm using to extract the last_insert_id 
from the table TABLE1, but it still don't works.
Infact I get always 0 from the variable id_ingresso, pheraphs in the 
database the row is correctly inserted.


Maybe it's a bug of the component?

This is the structure of the table:

CREATE TABLE `TABLE1`
(
`PK_TABLE1` integer (11) UNSIGNED  NOT NULL AUTO_INCREMENT ,
`FIELD1`varchar (20),
`FIELD2`varchar (20),
`FIELD3`datetime NOT NULL,
PRIMARY KEY (`PK_TABLE1`)
) TYPE=MyISAM


This is the code:

procedure TPassaggioGestito.RegistraPassaggioSulDB(Connessione: 
TSQLConnection);

var
 Qry: TSQLQuery;
 Trans: TSQLTransaction;
begin

 //parametri db per query
 Trans:=TSQLTransaction.Create(nil);
 Qry:=TSQLQuery.Create(nil);
 try
  Connessione.Transaction := Trans;
  Qry.DataBase := Connessione;
  Qry.Transaction := Trans;

  Connessione.StartTransaction;

  Qry.ParseSQL := true;
  Qry.ReadOnly := false;


  Qry.Active := false;
  Qry.SQL.Text := 'INSERT INTO TABLE1  '+
  '(FIELD1, FIELD2, FIELD3) '+
  'VALUES '+
  '(:FIELD1, :FIELD2, :FIELD3) ';
  Qry.Params.ParamByName('FIELD1').AsString := self.field1;
  Qry.Params.ParamByName('FIELD2').AsString := self.field2;
  Qry.Params.ParamByName('FIELD3').AsDateTime := self.field3;

  try
 Qry.ExecSQL;
  except
 Log.Scrivi(0,'Errore SQL in passaggigestiti: SQL = 
'+qry.SQL.Text+'');

  end;

  //la query viene ora usata in lettura
  Qry.Active := false;
  qry.ParseSQL := false;
  qry.ReadOnly := true;

  //leggo il pk_ingresso appena inserito
  Qry.SQL.Text := 'SELECT LAST_INSERT_ID() as PRIMARY_KEY';
  try
Qry.open;
self.id_ingresso := Qry.FieldByName('PRIMARY_KEY').AsInteger;
Qry.close;
  except
 Log.Scrivi(0,'Errore SQL in passaggigestiti: SQL = 
'+Qry.SQL.Text+'');

 self.id_ingresso := -1;
  end;

 finally
  Connessione.EndTransaction;
  Qry.Free;
  Trans.Free;
 end;

end;


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-15 Thread John

Alvise Nicoletti wrote:
Hi... this is the complete code I'm using to extract the 
last_insert_id from the table TABLE1, but it still don't works.
Infact I get always 0 from the variable id_ingresso, pheraphs in the 
database the row is correctly inserted.



Hi Alvise,

I haven't gone through you example completely, but try doing the same
thing by generating the sql text on the fly instead of using
parameters.  I was unable to get anything to work using parameters when
I last tried a few months ago.

cheers,
John

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-12 Thread Joost van der Sluis
Op vrijdag 12-10-2007 om 10:39 uur [tijdzone +0200], schreef Alvise
Nicoletti:

Qry.Active := false;

I don't see anything strange. It should work, except that the following
query is incorrect (incomplete).

Qry.SQL.Text := 'INSERT INTO ECCETERA';

And it also has no parameters. Maybe there's an error on your log?

Qry.Params.ParamByName('PK_parameter').AsInteger := self.id_parameter;
try
   Qry.ExecSQL;

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-12 Thread Alvise Nicoletti
The query was incomplete cause I censored it... just cause the mailing 
list is public and sometimes googling I found pieces of our customers 
stuff.


I mailed you in private the complete code.

Thank you.

Op vrijdag 12-10-2007 om 10:39 uur [tijdzone +0200], schreef Alvise
Nicoletti:

  

   Qry.Active := false;



I don't see anything strange. It should work, except that the following
query is incorrect (incomplete).

  

   Qry.SQL.Text := 'INSERT INTO ECCETERA';



And it also has no parameters. Maybe there's an error on your log?

  

   Qry.Params.ParamByName('PK_parameter').AsInteger := self.id_parameter;
   try
  Qry.ExecSQL;



Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



  


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-12 Thread Alvise Nicoletti

No, in the original code it's correct.

However: I'm still having problems, someone can show me some code about 
how to extract a last_insert_id from a mysql database after a insert, 
with SQLdb libs?

On 12/10/2007, Alvise Nicoletti [EMAIL PROTECTED] wrote:
---8---
  

   QryRead.Active := false;
   QryRead.SQL.Text := 'SELECT LAST_INSERT_ID() as PK_INGRESSO';
   try
 QryRead.open;
 self.id_ingresso := QryRead.FieldByName('PK_parameter').AsInteger;



must this not be:
self.id_ingresso := QryRead.FieldByName('PK_INGRESSO').AsInteger;?

henry

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



  


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb : get last_inserted_id

2007-10-12 Thread Henry Vermaak
On 12/10/2007, Alvise Nicoletti [EMAIL PROTECTED] wrote:
---8---

QryRead.Active := false;
QryRead.SQL.Text := 'SELECT LAST_INSERT_ID() as PK_INGRESSO';
try
  QryRead.open;
  self.id_ingresso := QryRead.FieldByName('PK_parameter').AsInteger;

must this not be:
self.id_ingresso := QryRead.FieldByName('PK_INGRESSO').AsInteger;?

henry

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb problem

2007-07-15 Thread Michael Van Canneyt


On Sat, 14 Jul 2007, Vincent Snijders wrote:

 Vincent Snijders schreef:
  Michael Van Canneyt schreef:
  
   I assume you are using a 2.1.5 compiler:
  
   I am not sure that TSQLScript and TSQLConnector are in the 2.1.5 sources.
   Simply try uncommenting the registration of these 2 components.
  
   In that case you may want to copy the latest inicols.pp file from
   subversion (in packages/fcl-base) to the LazDataDesktop project directory.
   The alternative is to update to the latest 2.1.5 sources from subversion.
  
  I don't understand the following change in r11507:
  
  --- /trunk/components/sqldb/registersqldb.pas2007/07/14 13:44:35
  11506
  +++ trunk/components/sqldb/registersqldb.pas2007/07/14 14:35:0811507
  @@ -24,6 +24,12 @@
   {$DEFINE HASPQCONNECTION}
   {$ENDIF}
  
  +{ SQLITE }
  +{$IFNDEF VER2_2}
  +{$IFNDEF VER2_0}
  +{$DEFINE HASSQLITE3CONNECTION}
  +{$ENDIF}
  +{$ENDIF}
   interface
  
   uses
  
  HASSQLITE3CONNECTION is defined when using fpc 2.1.5, but when using a
  future 2.2.0. Why? Everything in 2.1.5 is supposed to get into 2.2.0 too?

Simply forgot.

 
 Another possible problem about this patch:
 
 It includes SQLite for all targets, but the fpc makefile for doesn't compile
 it for win64. Where is the error, the fpc makefile or this patch?

Fixed that too meanwhile.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb problem

2007-07-14 Thread Michael Van Canneyt


On Sat, 14 Jul 2007, Charl van Jaarsveldt wrote:

 Hi,
 
 I was trying to compile the DataDesktop, and had to install the sqldb
 package to do so. Unfortunately the sqldb package doesn't want to compile.
 It fails to find TSQLScript and TSQLConnector. Does sqldb have some other
 dependency?

No.

I assume you are using a 2.1.5 compiler:

I am not sure that TSQLScript and TSQLConnector are in the 2.1.5 
sources. Simply try uncommenting the registration of these 2 
components.

In that case you may want to copy the latest inicols.pp file from 
subversion (in packages/fcl-base) to the LazDataDesktop project 
directory. The alternative is to update to the latest 2.1.5 
sources from subversion.

Michael. 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb problem

2007-07-14 Thread Charl van Jaarsveldt

Ah, so these are part of freepascal? I just noticed I am still using 2.0.4 -
the one that's in the ubuntu repositories.

Thanks :-)
Charl

On 7/14/07, Michael Van Canneyt [EMAIL PROTECTED] wrote:




On Sat, 14 Jul 2007, Charl van Jaarsveldt wrote:

 Hi,

 I was trying to compile the DataDesktop, and had to install the sqldb
 package to do so. Unfortunately the sqldb package doesn't want to
compile.
 It fails to find TSQLScript and TSQLConnector. Does sqldb have some
other
 dependency?

No.

I assume you are using a 2.1.5 compiler:

I am not sure that TSQLScript and TSQLConnector are in the 2.1.5
sources. Simply try uncommenting the registration of these 2
components.

In that case you may want to copy the latest inicols.pp file from
subversion (in packages/fcl-base) to the LazDataDesktop project
directory. The alternative is to update to the latest 2.1.5
sources from subversion.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives





--
I love deadlines. I especially love the whooshing sound they make as they
fly by. - Douglas Adams


Re: [lazarus] sqldb problem

2007-07-14 Thread Vincent Snijders

Michael Van Canneyt schreef:


On Sat, 14 Jul 2007, Charl van Jaarsveldt wrote:


Hi,

I was trying to compile the DataDesktop, and had to install the sqldb
package to do so. Unfortunately the sqldb package doesn't want to compile.
It fails to find TSQLScript and TSQLConnector. Does sqldb have some other
dependency?


No.

I assume you are using a 2.1.5 compiler:

I am not sure that TSQLScript and TSQLConnector are in the 2.1.5 
sources. Simply try uncommenting the registration of these 2 
components.


In that case you may want to copy the latest inicols.pp file from 
subversion (in packages/fcl-base) to the LazDataDesktop project 
directory. The alternative is to update to the latest 2.1.5 
sources from subversion.


I don't understand the following change in r11507:

--- /trunk/components/sqldb/registersqldb.pas   2007/07/14 13:44:35 11506
+++ trunk/components/sqldb/registersqldb.pas2007/07/14 14:35:08 11507
@@ -24,6 +24,12 @@
 {$DEFINE HASPQCONNECTION}
 {$ENDIF}

+{ SQLITE }
+{$IFNDEF VER2_2}
+{$IFNDEF VER2_0}
+{$DEFINE HASSQLITE3CONNECTION}
+{$ENDIF}
+{$ENDIF}
 interface

 uses

HASSQLITE3CONNECTION is defined when using fpc 2.1.5, but when using a 
future 2.2.0. Why? Everything in 2.1.5 is supposed to get into 2.2.0 too?


Vincent

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB sql connection on wince

2007-01-05 Thread Oro06

[EMAIL PROTECTED] wrote:

Yes, the xml request/response it's my second choice.

However, to do it, i need networking (at least http i think) so i need 
lnet libs.


If you give me some other tips in that sense, they would be so 
appreciated.


However i still have to see lnet working on WinCE :-(
i had good results with indy (http put, get; smtp send; pop get) on arm 
wince 4.2  5


for local db i use sqlite with run fine
(compiled arm dll are here 
ftp://ftp.freepascal.org/pub/fpc/contrib/arm-wince-sqlite322.zip)


for networking dataset transfert i use MemDS (provided in fcl)

prototype started last year, lcl was not ready in that time so forms 
(nearly 10) where coded with wince direct api calls

with basic .rc file and then windres to compile it.
All is already provided in fpc/rtl/wince

reagards
or

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-04 Thread Joost van der Sluis
On Wed, 2007-01-03 at 21:15 -0500, Lee Jenkins wrote:
 Kevin hayton wrote:
  
  I have just installed UIB components and there are components on the 
  palette.
  Using MEPIS 6.0 and lazarus 0.9.20 beta. Just downloaded the latest UIB 
  extracted to /usr/share/lazarus/components and installed the .lpk in 
  /source.
 
 Man, that is so odd.  I did essentially the same thing except all my 
 stuff was installed in /usr/lib/lazarus/coponents.  Same thing with lpk.

Ergo: you've installed lazarus TWICE. You were installing in one of
them, but you started the other one.

(one in /usr/lib/lazarus, and one in /usr/lib/shared)

Next question is: which distro do you use? If it's FC, you probably
installed the rpm provided by fedora, which installs
in /usr/lib/lazarus. But the rpm you can download on the lazarus website
installs to /usr/shared/lazarus

 And everything looked like it compiled fine too, at least no visible 
 errors that I could see.

I still find it stranghe, though, that he can't find the firebird-
client-library. But I think you've installed something else wrongly..

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-04 Thread Lee Jenkins

Joost van der Sluis wrote:

On Wed, 2007-01-03 at 21:15 -0500, Lee Jenkins wrote:

Kevin hayton wrote:

I have just installed UIB components and there are components on the palette.
Using MEPIS 6.0 and lazarus 0.9.20 beta. Just downloaded the latest UIB 
extracted to /usr/share/lazarus/components and installed the .lpk in /source.
Man, that is so odd.  I did essentially the same thing except all my 
stuff was installed in /usr/lib/lazarus/coponents.  Same thing with lpk.


Ergo: you've installed lazarus TWICE. You were installing in one of
them, but you started the other one.


No, I installed twice, but the second time only after uninstalling the 
first.  I don't have two separate installations.



(one in /usr/lib/lazarus, and one in /usr/lib/shared)



The only installation that I have is in /usr/lib/lazarus.  There is no 
/usr/lib/shared directory, et al or even as I think you mean, 
/usr/share/lazarus either.



Next question is: which distro do you use? If it's FC, you probably
installed the rpm provided by fedora, which installs
in /usr/lib/lazarus. But the rpm you can download on the lazarus website
installs to /usr/shared/lazarus



I am using CentOS4.4 and I installed the following from sourceforge:
fpc-2.0.40-i586.rpm
fpc-src-2.0.4-0.i386.rpm
lazarus-0.9.0.20-0.i386.rpm




And everything looked like it compiled fine too, at least no visible 
errors that I could see.


I still find it stranghe, though, that he can't find the firebird-
client-library. But I think you've installed something else wrongly..



Yes, very strange.  As I mentioned in another thread, I am pretty new to 
linux so I wasn't sure what the behavior of shared objects (dll's) would 
be.  It just made sense that the components would look first in the 
application directory, but is not finding them.   I even tried putting 
copies where I thought it might look for them such as /bin, /usr/bin, 
/usr/lib, etc. and still no love.


Thanks for replying!

--

Warm Regards,

Lee

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-04 Thread Lee Jenkins

Lee Jenkins wrote:




I have tried to almost two days straight, ignoring just about everything 
else in my business to get some kind of workable database access through 
Lazarus without any success.


This morning, I even tried installing from source and that seemed to go 
OK except for the fact that I still cannot install any non-default 
components into the IDE.


The IBConnection components don't recognize the .so libraries for 
firebird.  I cannot install UIB.


At this point I am all out of ideas and patience.

* Reinstall from rpm again?
* Rebuild source again?
* Install from source again?
* Try to reinstall components that will not install again?


--

Warm Regards,

Lee

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-04 Thread Lee Jenkins

Lee Jenkins wrote:

Lee Jenkins wrote:




I have tried to almost two days straight, ignoring just about everything 
else in my business to get some kind of workable database access through 
Lazarus without any success.


This morning, I even tried installing from source and that seemed to go 
OK except for the fact that I still cannot install any non-default 
components into the IDE.


The IBConnection components don't recognize the .so libraries for 
firebird.  I cannot install UIB.


At this point I am all out of ideas and patience.

* Reinstall from rpm again?
* Rebuild source again?
* Install from source again?
* Try to reinstall components that will not install again?



Oh, and I forgot, thanks to everyone for their time and patience ;)

I'm just a bit frustrated right now, lol.

--

Warm Regards,

Lee

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB sql connection on wince

2007-01-04 Thread Lee Jenkins

[EMAIL PROTECTED] wrote:

Hi.

Did someone know if it is possible to use SQLdb to connect to a mysql 
server through tcp/ip with wince?


Actually, vincent is trying to make lnet libs work on wince but even if 
he have success that's not enough for me, i need to get some data from a 
database...




I had to do something similar a while back, but with .net.  No firebird 
drivers at the time for pocketpc framework so I ended up writing a 
middleware based on xml request/response to the database.  Just an idea 
if you don't find anything else...



--

Warm Regards,

Lee

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-04 Thread Joost van der Sluis
On Thu, 2007-01-04 at 09:09 -0500, Lee Jenkins wrote:
 Joost van der Sluis wrote:
  On Wed, 2007-01-03 at 21:15 -0500, Lee Jenkins wrote:
  Kevin hayton wrote:
  I have just installed UIB components and there are components on the 
  palette.
  Using MEPIS 6.0 and lazarus 0.9.20 beta. Just downloaded the latest UIB 
  extracted to /usr/share/lazarus/components and installed the .lpk in 
  /source.
  Man, that is so odd.  I did essentially the same thing except all my 
  stuff was installed in /usr/lib/lazarus/coponents.  Same thing with lpk.
  
  Ergo: you've installed lazarus TWICE. You were installing in one of
  them, but you started the other one.
 
 No, I installed twice, but the second time only after uninstalling the 
 first.  I don't have two separate installations.
 
  (one in /usr/lib/lazarus, and one in /usr/lib/shared)
  
 
 The only installation that I have is in /usr/lib/lazarus.  There is no 
 /usr/lib/shared directory, et al or even as I think you mean, 
 /usr/share/lazarus either.
 
  Next question is: which distro do you use? If it's FC, you probably
  installed the rpm provided by fedora, which installs
  in /usr/lib/lazarus. But the rpm you can download on the lazarus website
  installs to /usr/shared/lazarus
  
 
 I am using CentOS4.4 and I installed the following from sourceforge:
 fpc-2.0.40-i586.rpm
 fpc-src-2.0.4-0.i386.rpm
 lazarus-0.9.0.20-0.i386.rpm

Which is strange, since this rpm installs in /usr/local/share... Not lib


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-04 Thread Lee Jenkins

Lee Jenkins wrote:


After not getting the sqlite components to install or be usable from a 
lazarus project through reference to the units, I on to try the SQLDB 
ibconnection component now.





Just so that it will be archived, I wanted to post the resolution to the 
original issue I had and the reason for this post.  I was unable to 
using firebirdsql related components because they complained they they 
could not load the appropriate library (libfbclient.so).


Hopefully someone who is wondering why firebird related components 
cannot load the libfbclient.so library will find this.


The text of the post is listed below.  Installing compat-libstdc++-33 
fixed the problem on my CentOS 4 box.


--

Warm Regards,

Lee


 Installing from the rpm, no programs can run because they say that
 client libraries cannot be loaded. I poked around after reading over
 the release notes and I see the libraries there in /opt/firebird/lib
 with links to them in /usr/lib.

 I'm trying to connect from lazarus (latest builds) using uib and
even if
 I point the component directly to the libfbclient.so link in
/usr/lib, I
 get the same thing.

 I also tried running isql which threw an exception saying that
 libstdc++.so.5 could be opened No such file or directory.

 The installation with the rpm seemd to go fine, no errors or mention of
 missing dependencies, etc.

 I've worked with fb on windows quite a bit, but I'm just cutting my
 teeth on linux so any pointers would be appreciated.

I don't know which packages are required by CentOS, but this is a
common issue: you need a C++ library compatibility package.

compat-libstdc++-8 (Fedora Core 3)
compat-libstdc++-33 (Fedora Core 5; Red Hat Enterprise Linux 4)

This should fix it.

Steve


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-03 Thread Lee Jenkins

Lee Jenkins wrote:


After not getting the sqlite components to install or be usable from a 
lazarus project through reference to the units, I on to try the SQLDB 
ibconnection component now.


Has anyone else had any luck with these components?  I'm trying to use 
them and I get an exception about not being able to access the libgds.so 
or libfbclient.so.




I just tried installing UIB components and while there was no error, 
there is no components on the palette for them either.


I *really* don't want this to sound the right way, but is it even 
possible to install non-default components on in the IDE on linux?



--

Warm Regards,

Lee

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-03 Thread Kevin hayton
On Thursday 04 January 2007 2:16 pm, Lee Jenkins wrote:
 Lee Jenkins wrote:
  After not getting the sqlite components to install or be usable from a
  lazarus project through reference to the units, I on to try the SQLDB
  ibconnection component now.
 
  Has anyone else had any luck with these components?  I'm trying to use
  them and I get an exception about not being able to access the libgds.so
  or libfbclient.so.

 I just tried installing UIB components and while there was no error,
 there is no components on the palette for them either.

 I *really* don't want this to sound the right way, but is it even
 possible to install non-default components on in the IDE on linux?

I have just installed UIB components and there are components on the palette.
Using MEPIS 6.0 and lazarus 0.9.20 beta. Just downloaded the latest UIB 
extracted to /usr/share/lazarus/components and installed the .lpk in /source.

Regards
KevinH

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB TIBConnection

2007-01-03 Thread Lee Jenkins

Kevin hayton wrote:


I have just installed UIB components and there are components on the palette.
Using MEPIS 6.0 and lazarus 0.9.20 beta. Just downloaded the latest UIB 
extracted to /usr/share/lazarus/components and installed the .lpk in /source.


Man, that is so odd.  I did essentially the same thing except all my 
stuff was installed in /usr/lib/lazarus/coponents.  Same thing with lpk.


And everything looked like it compiled fine too, at least no visible 
errors that I could see.


--

Warm Regards,

Lee

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB query not working at runtime

2006-09-19 Thread Michael Van Canneyt



On Tue, 19 Sep 2006, Nataraj S Narayan wrote:


Hi

svn update fpc
At revision 4559.

svn update lazarus
At revision 9827.


Anything wrong with the following ? I dont get any result when I should
be getting.



object SQLQuery1: TSQLQuery
 Active = True
 Database = MySQL41Connection1
 Transaction = SQLTransaction1
 SQL.Strings = (
   'select * from purchorders where orderno=:morderno'
 )
 Params = 
   item
 Name = 'morderno'
   end
 UpdateMode = upWhereKeyOnly
 UsePrimaryKeyAsKey = True
 ParseSQL = True
 left = 80
 top = 192
end


implementation

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
 with SqlQuery1 do
 begin
  close;
  params[0].asinteger:=StrToInt(Edit1.Text);
  ExecSQL;


You must remove the ExecSQL. That is only for insert/update/delete/DDL 
statements.

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-26 Thread Zlatko Matic

Yes, that was me:)
DABO seems to be prommising...

- Original Message - 
From: johnf [EMAIL PROTECTED]

To: lazarus@miraclec.com
Sent: Wednesday, July 26, 2006 12:51 AM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions


Great - I noticed someone with the same name has been asking about 
accessing

Postgres using python- is that you by chance.  I have used psycopg with
success.  You might also want to check out 'DABO' I wrote the postgres
interface.

John
On Tuesday 25 July 2006 14:53, Zlatko Matic wrote:

I would lke to try it:)

- Original Message -
From: johnf [EMAIL PROTECTED]
To: lazarus@miraclec.com
Sent: Tuesday, July 25, 2006 8:18 PM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions

I haven't used ODBC but have used SQLDB to connect, update,
delete,select
 etc  Why use ODBC - just wondering?
 John

 On Tuesday 25 July 2006 09:26, Zlatko Matic wrote:
 Has anybody successfully connected to PostgreSQL using ODBC?

 Zlatko

 - Original Message -
 From: Bram Kuijvenhoven [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; lazarus@miraclec.com
 Sent: Tuesday, July 25, 2006 1:20 PM
 Subject: Re: [lazarus] Sqldb ,MySql and Transactions

  Nataraj S Narayan wrote:
  I havent succeeded in getting ODBC for MySQL working. But other
  native SQLDB compos are working for MySql 4.1.1.
 
  The following (from your other mail)
 
   object MySQL41Connection1: TMySQL41Connection
 DatabaseName = 'weberp'
 Password = 'rambo1'
 UserName = 'ODBC'
 HostName = '192.168.1.77'
 ...
   end
 
  should be translated to (for Windows)
 
   object ODBCConnection1: TODBCConnection
 Driver = 'MySQL ODBC 3.51 Driver'
 Username = 'ODBC'
 Password = 'rambo1'
 // I don't know how this is put in a lfm file, but I'm sure you
  understand what I mean by the below
 Params = object TStringList Items = 'SERVER=192.168.1.77',
   'DATABASE=weberp'
 end
   end
 
  Joost has said that MySql 4.x.x dont support transactions.
 
  Will transactions work with ODBC? I have used
  Database1.StartTransaction
  and commit and Roll back with Delphi4 + MyODBC 3.51.
 
  The ODBC component does not support transactions (at the moment). Of
  course ODBC supports transactions, but I haven't implemented it yet,
  partially because it not entirely trivial.
 
  I need to use connection handles because there exist no transaction
  handles in ODBC; i.e. there is always one transaction per 
  connection.
  Luckily there is a connection cache in ODBC, but I'd need to dive 
  into
  that a little bit to make sure transactions won't slow every down 
  too

  much (because of an entire reconnects instead of connection cache
  reuses).
 
  So, which is better - odbc compo or native compo?
 
  I don't know the native component very well, so I can't tell you 
  much

  about that. If you need transactions, neither will suffice actually,
  according to the above information. Of course you are welcome to
  create a
  patch implementing transaction support in either component!
 
 
  One advantage of ODBC over native mysql components is that the 4.x
  mysql
  client library (or higher) is GPLed, whereas the ODBC components are
  not.
  This is particularly important if you are writing an application 
  that

  is
  not open source, e.g. a commercial application.
 
  For precise details see 
  http://www.mysql.com/company/legal/licensing/

  and
  in particular
  http://www.mysql.com/company/legal/licensing/foss-exception.html 
  (this

  page contains an important exception to the GPL; it has a list of
  licenses; if I understand it correctly, applications where each part
  is licensed under one of those (open source!) licenses are allowed 
  to

  use the MySQL client lib).
 
  Regards,
 
  Bram
 
 
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

 _
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives 


_
To unsubscribe: mail [EMAIL

Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-26 Thread Nataraj S Narayan

Hi

That makes 3 of us dabbling in lazarus as well as Dabo.
But i am in the mid-waters. To do some 'real' stuff, i need to get back 
to Delphi.


regards

Nataraj



Zlatko Matic wrote:


Yes, that was me:)
DABO seems to be prommising...

- Original Message - From: johnf [EMAIL PROTECTED]
To: lazarus@miraclec.com
Sent: Wednesday, July 26, 2006 12:51 AM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions


Great - I noticed someone with the same name has been asking about 
accessing

Postgres using python- is that you by chance.  I have used psycopg with
success.  You might also want to check out 'DABO' I wrote the postgres
interface.

John
On Tuesday 25 July 2006 14:53, Zlatko Matic wrote:


I would lke to try it:)

- Original Message -
From: johnf [EMAIL PROTECTED]
To: lazarus@miraclec.com
Sent: Tuesday, July 25, 2006 8:18 PM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions

I haven't used ODBC but have used SQLDB to connect, update,
delete,select
 etc  Why use ODBC - just wondering?
 John

 On Tuesday 25 July 2006 09:26, Zlatko Matic wrote:
 Has anybody successfully connected to PostgreSQL using ODBC?

 Zlatko

 - Original Message -
 From: Bram Kuijvenhoven [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; lazarus@miraclec.com
 Sent: Tuesday, July 25, 2006 1:20 PM
 Subject: Re: [lazarus] Sqldb ,MySql and Transactions

  Nataraj S Narayan wrote:
  I havent succeeded in getting ODBC for MySQL working. But other
  native SQLDB compos are working for MySql 4.1.1.
 
  The following (from your other mail)
 
   object MySQL41Connection1: TMySQL41Connection
 DatabaseName = 'weberp'
 Password = 'rambo1'
 UserName = 'ODBC'
 HostName = '192.168.1.77'
 ...
   end
 
  should be translated to (for Windows)
 
   object ODBCConnection1: TODBCConnection
 Driver = 'MySQL ODBC 3.51 Driver'
 Username = 'ODBC'
 Password = 'rambo1'
 // I don't know how this is put in a lfm file, but I'm sure you
  understand what I mean by the below
 Params = object TStringList Items = 'SERVER=192.168.1.77',
   'DATABASE=weberp'
 end
   end
 
  Joost has said that MySql 4.x.x dont support transactions.
 
  Will transactions work with ODBC? I have used
  Database1.StartTransaction
  and commit and Roll back with Delphi4 + MyODBC 3.51.
 
  The ODBC component does not support transactions (at the 
moment). Of
  course ODBC supports transactions, but I haven't implemented it 
yet,

  partially because it not entirely trivial.
 
  I need to use connection handles because there exist no 
transaction
  handles in ODBC; i.e. there is always one transaction per   
connection.
  Luckily there is a connection cache in ODBC, but I'd need to 
dive   into
  that a little bit to make sure transactions won't slow every 
down   too

  much (because of an entire reconnects instead of connection cache
  reuses).
 
  So, which is better - odbc compo or native compo?
 
  I don't know the native component very well, so I can't tell 
you   much
  about that. If you need transactions, neither will suffice 
actually,

  according to the above information. Of course you are welcome to
  create a
  patch implementing transaction support in either component!
 
 
  One advantage of ODBC over native mysql components is that the 4.x
  mysql
  client library (or higher) is GPLed, whereas the ODBC 
components are

  not.
  This is particularly important if you are writing an 
application   that

  is
  not open source, e.g. a commercial application.
 
  For precise details see   
http://www.mysql.com/company/legal/licensing/

  and
  in particular
  
http://www.mysql.com/company/legal/licensing/foss-exception.html  
 (this

  page contains an important exception to the GPL; it has a list of
  licenses; if I understand it correctly, applications where each 
part
  is licensed under one of those (open source!) licenses are 
allowed   to

  use the MySQL client lib).
 
  Regards,
 
  Bram
 
 
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

 _
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives



_
To unsubscribe: mail [EMAIL PROTECTED

Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-25 Thread Bram Kuijvenhoven

Nataraj S Narayan wrote:
I havent succeeded in getting ODBC for MySQL working. But other native 
SQLDB compos are working for MySql 4.1.1.


The following (from your other mail)

 object MySQL41Connection1: TMySQL41Connection
   DatabaseName = 'weberp'
   Password = 'rambo1'
   UserName = 'ODBC'
   HostName = '192.168.1.77'
   ...
 end

should be translated to (for Windows)

 object ODBCConnection1: TODBCConnection
   Driver = 'MySQL ODBC 3.51 Driver'
   Username = 'ODBC'
   Password = 'rambo1'
   // I don't know how this is put in a lfm file, but I'm sure you understand 
what I mean by the below
   Params = object TStringList 
 Items = 'SERVER=192.168.1.77',

 'DATABASE=weberp'
   end
 end


Joost has said that MySql 4.x.x dont support transactions.

Will transactions work with ODBC? I have used Database1.StartTransaction 
and commit and Roll back with Delphi4 + MyODBC 3.51.


The ODBC component does not support transactions (at the moment). Of course 
ODBC supports transactions, but I haven't implemented it yet, partially because 
it not entirely trivial.

I need to use connection handles because there exist no transaction handles in 
ODBC; i.e. there is always one transaction per connection. Luckily there is a 
connection cache in ODBC, but I'd need to dive into that a little bit to make 
sure transactions won't slow every down too much (because of an entire 
reconnects instead of connection cache reuses).


So, which is better - odbc compo or native compo?


I don't know the native component very well, so I can't tell you much about 
that. If you need transactions, neither will suffice actually, according to the 
above information. Of course you are welcome to create a patch implementing 
transaction support in either component!


One advantage of ODBC over native mysql components is that the 4.x mysql client 
library (or higher) is GPLed, whereas the ODBC components are not. This is 
particularly important if you are writing an application that is not open 
source, e.g. a commercial application.

For precise details see http://www.mysql.com/company/legal/licensing/ and in 
particular http://www.mysql.com/company/legal/licensing/foss-exception.html 
(this page contains an important exception to the GPL; it has a list of 
licenses; if I understand it correctly, applications where each part is 
licensed under one of those (open source!) licenses are allowed to use the 
MySQL client lib).

Regards,

Bram


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-25 Thread Zlatko Matic

Has anybody successfully connected to PostgreSQL using ODBC?

Zlatko

- Original Message - 
From: Bram Kuijvenhoven [EMAIL PROTECTED]

To: [EMAIL PROTECTED]; lazarus@miraclec.com
Sent: Tuesday, July 25, 2006 1:20 PM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions



Nataraj S Narayan wrote:
I havent succeeded in getting ODBC for MySQL working. But other native 
SQLDB compos are working for MySql 4.1.1.


The following (from your other mail)

 object MySQL41Connection1: TMySQL41Connection
   DatabaseName = 'weberp'
   Password = 'rambo1'
   UserName = 'ODBC'
   HostName = '192.168.1.77'
   ...
 end

should be translated to (for Windows)

 object ODBCConnection1: TODBCConnection
   Driver = 'MySQL ODBC 3.51 Driver'
   Username = 'ODBC'
   Password = 'rambo1'
   // I don't know how this is put in a lfm file, but I'm sure you 
understand what I mean by the below

   Params = object TStringList Items = 'SERVER=192.168.1.77',
 'DATABASE=weberp'
   end
 end


Joost has said that MySql 4.x.x dont support transactions.

Will transactions work with ODBC? I have used Database1.StartTransaction 
and commit and Roll back with Delphi4 + MyODBC 3.51.


The ODBC component does not support transactions (at the moment). Of 
course ODBC supports transactions, but I haven't implemented it yet, 
partially because it not entirely trivial.


I need to use connection handles because there exist no transaction 
handles in ODBC; i.e. there is always one transaction per connection. 
Luckily there is a connection cache in ODBC, but I'd need to dive into 
that a little bit to make sure transactions won't slow every down too much 
(because of an entire reconnects instead of connection cache reuses).



So, which is better - odbc compo or native compo?


I don't know the native component very well, so I can't tell you much 
about that. If you need transactions, neither will suffice actually, 
according to the above information. Of course you are welcome to create a 
patch implementing transaction support in either component!



One advantage of ODBC over native mysql components is that the 4.x mysql 
client library (or higher) is GPLed, whereas the ODBC components are not. 
This is particularly important if you are writing an application that is 
not open source, e.g. a commercial application.


For precise details see http://www.mysql.com/company/legal/licensing/ and 
in particular 
http://www.mysql.com/company/legal/licensing/foss-exception.html (this 
page contains an important exception to the GPL; it has a list of 
licenses; if I understand it correctly, applications where each part is 
licensed under one of those (open source!) licenses are allowed to use the 
MySQL client lib).


Regards,

Bram


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-25 Thread johnf
I haven't used ODBC but have used SQLDB to connect, update, delete,select 
etc  Why use ODBC - just wondering?
John
On Tuesday 25 July 2006 09:26, Zlatko Matic wrote:
 Has anybody successfully connected to PostgreSQL using ODBC?

 Zlatko

 - Original Message -
 From: Bram Kuijvenhoven [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; lazarus@miraclec.com
 Sent: Tuesday, July 25, 2006 1:20 PM
 Subject: Re: [lazarus] Sqldb ,MySql and Transactions

  Nataraj S Narayan wrote:
  I havent succeeded in getting ODBC for MySQL working. But other native
  SQLDB compos are working for MySql 4.1.1.
 
  The following (from your other mail)
 
   object MySQL41Connection1: TMySQL41Connection
 DatabaseName = 'weberp'
 Password = 'rambo1'
 UserName = 'ODBC'
 HostName = '192.168.1.77'
 ...
   end
 
  should be translated to (for Windows)
 
   object ODBCConnection1: TODBCConnection
 Driver = 'MySQL ODBC 3.51 Driver'
 Username = 'ODBC'
 Password = 'rambo1'
 // I don't know how this is put in a lfm file, but I'm sure you
  understand what I mean by the below
 Params = object TStringList Items = 'SERVER=192.168.1.77',
   'DATABASE=weberp'
 end
   end
 
  Joost has said that MySql 4.x.x dont support transactions.
 
  Will transactions work with ODBC? I have used Database1.StartTransaction
  and commit and Roll back with Delphi4 + MyODBC 3.51.
 
  The ODBC component does not support transactions (at the moment). Of
  course ODBC supports transactions, but I haven't implemented it yet,
  partially because it not entirely trivial.
 
  I need to use connection handles because there exist no transaction
  handles in ODBC; i.e. there is always one transaction per connection.
  Luckily there is a connection cache in ODBC, but I'd need to dive into
  that a little bit to make sure transactions won't slow every down too
  much (because of an entire reconnects instead of connection cache
  reuses).
 
  So, which is better - odbc compo or native compo?
 
  I don't know the native component very well, so I can't tell you much
  about that. If you need transactions, neither will suffice actually,
  according to the above information. Of course you are welcome to create a
  patch implementing transaction support in either component!
 
 
  One advantage of ODBC over native mysql components is that the 4.x mysql
  client library (or higher) is GPLed, whereas the ODBC components are not.
  This is particularly important if you are writing an application that is
  not open source, e.g. a commercial application.
 
  For precise details see http://www.mysql.com/company/legal/licensing/ and
  in particular
  http://www.mysql.com/company/legal/licensing/foss-exception.html (this
  page contains an important exception to the GPL; it has a list of
  licenses; if I understand it correctly, applications where each part is
  licensed under one of those (open source!) licenses are allowed to use
  the MySQL client lib).
 
  Regards,
 
  Bram
 
 
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-25 Thread Zlatko Matic

I would lke to try it:)

- Original Message - 
From: johnf [EMAIL PROTECTED]

To: lazarus@miraclec.com
Sent: Tuesday, July 25, 2006 8:18 PM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions


I haven't used ODBC but have used SQLDB to connect, update, 
delete,select

etc  Why use ODBC - just wondering?
John
On Tuesday 25 July 2006 09:26, Zlatko Matic wrote:

Has anybody successfully connected to PostgreSQL using ODBC?

Zlatko

- Original Message -
From: Bram Kuijvenhoven [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; lazarus@miraclec.com
Sent: Tuesday, July 25, 2006 1:20 PM
Subject: Re: [lazarus] Sqldb ,MySql and Transactions

 Nataraj S Narayan wrote:
 I havent succeeded in getting ODBC for MySQL working. But other native
 SQLDB compos are working for MySql 4.1.1.

 The following (from your other mail)

  object MySQL41Connection1: TMySQL41Connection
DatabaseName = 'weberp'
Password = 'rambo1'
UserName = 'ODBC'
HostName = '192.168.1.77'
...
  end

 should be translated to (for Windows)

  object ODBCConnection1: TODBCConnection
Driver = 'MySQL ODBC 3.51 Driver'
Username = 'ODBC'
Password = 'rambo1'
// I don't know how this is put in a lfm file, but I'm sure you
 understand what I mean by the below
Params = object TStringList Items = 'SERVER=192.168.1.77',
  'DATABASE=weberp'
end
  end

 Joost has said that MySql 4.x.x dont support transactions.

 Will transactions work with ODBC? I have used 
 Database1.StartTransaction

 and commit and Roll back with Delphi4 + MyODBC 3.51.

 The ODBC component does not support transactions (at the moment). Of
 course ODBC supports transactions, but I haven't implemented it yet,
 partially because it not entirely trivial.

 I need to use connection handles because there exist no transaction
 handles in ODBC; i.e. there is always one transaction per connection.
 Luckily there is a connection cache in ODBC, but I'd need to dive into
 that a little bit to make sure transactions won't slow every down too
 much (because of an entire reconnects instead of connection cache
 reuses).

 So, which is better - odbc compo or native compo?

 I don't know the native component very well, so I can't tell you much
 about that. If you need transactions, neither will suffice actually,
 according to the above information. Of course you are welcome to create 
 a

 patch implementing transaction support in either component!


 One advantage of ODBC over native mysql components is that the 4.x 
 mysql
 client library (or higher) is GPLed, whereas the ODBC components are 
 not.
 This is particularly important if you are writing an application that 
 is

 not open source, e.g. a commercial application.

 For precise details see http://www.mysql.com/company/legal/licensing/ 
 and

 in particular
 http://www.mysql.com/company/legal/licensing/foss-exception.html (this
 page contains an important exception to the GPL; it has a list of
 licenses; if I understand it correctly, applications where each part is
 licensed under one of those (open source!) licenses are allowed to use
 the MySQL client lib).

 Regards,

 Bram


 _
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-25 Thread johnf
Great - I noticed someone with the same name has been asking about accessing 
Postgres using python- is that you by chance.  I have used psycopg with 
success.  You might also want to check out 'DABO' I wrote the postgres 
interface.

John
On Tuesday 25 July 2006 14:53, Zlatko Matic wrote:
 I would lke to try it:)

 - Original Message -
 From: johnf [EMAIL PROTECTED]
 To: lazarus@miraclec.com
 Sent: Tuesday, July 25, 2006 8:18 PM
 Subject: Re: [lazarus] Sqldb ,MySql and Transactions

 I haven't used ODBC but have used SQLDB to connect, update,
 delete,select
  etc  Why use ODBC - just wondering?
  John
 
  On Tuesday 25 July 2006 09:26, Zlatko Matic wrote:
  Has anybody successfully connected to PostgreSQL using ODBC?
 
  Zlatko
 
  - Original Message -
  From: Bram Kuijvenhoven [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; lazarus@miraclec.com
  Sent: Tuesday, July 25, 2006 1:20 PM
  Subject: Re: [lazarus] Sqldb ,MySql and Transactions
 
   Nataraj S Narayan wrote:
   I havent succeeded in getting ODBC for MySQL working. But other
   native SQLDB compos are working for MySql 4.1.1.
  
   The following (from your other mail)
  
object MySQL41Connection1: TMySQL41Connection
  DatabaseName = 'weberp'
  Password = 'rambo1'
  UserName = 'ODBC'
  HostName = '192.168.1.77'
  ...
end
  
   should be translated to (for Windows)
  
object ODBCConnection1: TODBCConnection
  Driver = 'MySQL ODBC 3.51 Driver'
  Username = 'ODBC'
  Password = 'rambo1'
  // I don't know how this is put in a lfm file, but I'm sure you
   understand what I mean by the below
  Params = object TStringList Items = 'SERVER=192.168.1.77',
'DATABASE=weberp'
  end
end
  
   Joost has said that MySql 4.x.x dont support transactions.
  
   Will transactions work with ODBC? I have used
   Database1.StartTransaction
   and commit and Roll back with Delphi4 + MyODBC 3.51.
  
   The ODBC component does not support transactions (at the moment). Of
   course ODBC supports transactions, but I haven't implemented it yet,
   partially because it not entirely trivial.
  
   I need to use connection handles because there exist no transaction
   handles in ODBC; i.e. there is always one transaction per connection.
   Luckily there is a connection cache in ODBC, but I'd need to dive into
   that a little bit to make sure transactions won't slow every down too
   much (because of an entire reconnects instead of connection cache
   reuses).
  
   So, which is better - odbc compo or native compo?
  
   I don't know the native component very well, so I can't tell you much
   about that. If you need transactions, neither will suffice actually,
   according to the above information. Of course you are welcome to
   create a
   patch implementing transaction support in either component!
  
  
   One advantage of ODBC over native mysql components is that the 4.x
   mysql
   client library (or higher) is GPLed, whereas the ODBC components are
   not.
   This is particularly important if you are writing an application that
   is
   not open source, e.g. a commercial application.
  
   For precise details see http://www.mysql.com/company/legal/licensing/
   and
   in particular
   http://www.mysql.com/company/legal/licensing/foss-exception.html (this
   page contains an important exception to the GPL; it has a list of
   licenses; if I understand it correctly, applications where each part
   is licensed under one of those (open source!) licenses are allowed to
   use the MySQL client lib).
  
   Regards,
  
   Bram
  
  
   _
   To unsubscribe: mail [EMAIL PROTECTED] with
  unsubscribe as the Subject
 archives at http://www.lazarus.freepascal.org/mailarchives
 
  _
   To unsubscribe: mail [EMAIL PROTECTED] with
  unsubscribe as the Subject
 archives at http://www.lazarus.freepascal.org/mailarchives
 
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] Sqldb ,MySql and Transactions

2006-07-24 Thread Nataraj S Narayan

Hi Bram

I havent succeeded in getting ODBC for MySQL working. But other native 
SQLDB compos are working for MySql 4.1.1.


Joost has said that MySql 4.x.x dont support transactions.

Will transactions work with ODBC? I have used Database1.StartTransaction 
and commit and Roll back with Delphi4 + MyODBC 3.51.


So, which is better - odbc compo or native compo?

regards

Nataraj


Bram Kuijvenhoven wrote:


Nataraj S Narayan wrote:


 Plz suggest me which is the best package to connect to  Mysql 4.1.11
server?



If the MySQL components don't work for you, you can try the 
TODBCConnection component.


Please note that you need the TODBCConnection.Params property to set 
connection parameters like


'SERVER=myhost.com'
'PORT=3306'
'DATABASE=mydb'

(it is a TStrings; each string should be of the form 
'parameter=value', without the quotes of course)


You also need to set the
- TODBCConnection.Driver to 'MySQL' (Windows: 'MySQL ODBC 3.51 Driver')
- TODBCConnection.Username to your username
- TODBCConnection.Password to your password
See the notes in the class definition in the source of the component 
for more details; also keep in mind that some properties of 
TODBConnection are not used, like Hostname. Also the property 
TODBCConnection.Database has a different meaning! You need the Params 
property to set these ODBC driver dependent properties.


Note that alternatively, you can create a datasource in the ODBC 
Driver manager, save it to a file and refer to it using the FileDSN 
property.
To connect to MySQL using ODBC you need to install the following 
(Debian) packages:


 unixodbc
 unixodbc-dev
 unixodbc-bin (optional GUI tools)
 libmyodbc

Regards,

Bram

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives




begin:vcard
fn:http://www.gsis.ac.in
n:S Narayan;Nataraj
org:Good Shepherd International School;Software
adr:Niligiris, ;;M.Palada;Ootacamund;TN;643004;INDIA
email;internet:[EMAIL PROTECTED]
title:Project Coordinator
tel;work:0423 2550371 - 307
x-mozilla-html:TRUE
url:http://www.gsis.ac.in
version:2.1
end:vcard



Re: [lazarus] SQLDb,Mysql and TTable component

2006-07-22 Thread Joost van der Sluis
 I gave an SQLQuery2 with SQL = 'select * from purchdtemp'
 I mapped its datasource to a dbgrid. But the dbgrid acts 'read only'
 now. This is a temporary table I which I used in Delphi for keying in
 Purchase order details. Then, I write the data from this table to
 actual 'purchorderdetails', after keying in the whole PO.
 
 So each time the program is loaded, this table is made empty.
 
 what do i do?

You have to remove your 'reply-to' adress from your mail-client, read
the wiki, try the examples, search the web, look how it's done in Delphi
and maybe set the 'read-only' property to false and parsesql to true.

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDb,Mysql and TTable component

2006-07-22 Thread johnf
I have not seen your code but in general the idea of a temporary table to 
update a permanent table is not the normal way to use SQL.  When you start 
adding data to a table from the program it will not be written until you 
'commit'.  Therefore, appending or any changes to a table can be considered a 
temporary table until it is committed. In fact that is how SQLdb works - it 
creates a temporary table for you (sort of).   A begin transaction is sent 
to database engine.  To save the data just commit after validating or any 
changes, etc...  So instead of creating a routine to transfer the data from 
the temporary table to the real table - just use the Begin, Rollback and 
commit routines available from the SQL.  SQLdb does most of the work for 
you.  Send a 'SELECT' statement and a begin is also sent. 

However, I see how it could be a nice way to collect data and then validate 
the data before committing.  In fact the DBgrid can be used as you suggest.  
But the DBgrid does not need to be a temporary table but the real table.
  
Regarding your question about the read only I have no idea.  I haven't had it 
happen to me with out me setting it.
John

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDb,Mysql and TTable component

2006-07-21 Thread Joost van der Sluis
 I need to have a TTable component for MySQL using SQLDB. This is to 
 straight away key in data into the table using dbgrid.

You can do that with sqldb

 How do I simulate this using a TSQLQuery compo? Will 'InsertSQL' 
 property help me this?

It could, but in the most cases (select * from table) you won't need
it. 

 Where do I get the docs for TSQLQuery component?

;) docs?

There are some documents on the wiki, and you can have a look at the
examples (fcl/db/sqldb/examples) or maybe the db-tests (fcl/dbtests)

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDb,Mysql and TTable component

2006-07-21 Thread Nataraj S Narayan




Hi

I gave an SQLQuery2 with SQL = 'select * from purchdtemp'
I mapped its datasource to a dbgrid. But the dbgrid acts 'read only'
now. This is a temporary table I which I used in Delphi for keying in
Purchase order details. Then, I write the data from this table to
actual 'purchorderdetails', after keying in the whole PO.

So each time the program is loaded, this table is made empty.

what do i do?

regards

Nataraj

Joost van der Sluis wrote:

  
I need to have a TTable component for MySQL using SQLDB. This is to 
straight away key in data into the table using dbgrid.

  
  
  



  You can do that with sqldb

  
  
How do I simulate this using a TSQLQuery compo? Will 'InsertSQL' 
property help me this?

  
  
It could, but in the most cases (select * from table) you won't need
it. 

  





  
  
Where do I get the docs for TSQLQuery component?

  
  
;) docs?

There are some documents on the wiki, and you can have a look at the
examples (fcl/db/sqldb/examples) or maybe the db-tests (fcl/dbtests)

Joost

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


  




begin:vcard
fn:http://www.gsis.ac.in
n:S Narayan;Nataraj
org:Good Shepherd International School;Software
adr:Niligiris, ;;M.Palada;Ootacamund;TN;643004;INDIA
email;internet:[EMAIL PROTECTED]
title:Project Coordinator
tel;work:0423 2550371 - 307
x-mozilla-html:TRUE
url:http://www.gsis.ac.in
version:2.1
end:vcard



Re: [lazarus] SQLDb,Mysql,TSQLQuery and IndexDefs

2006-07-21 Thread Nataraj S Narayan

Hi Joost

How am I getting 72 IndexDefs inside a TSQLQuery component?

When trying to remove these, lazarus crashed.


regards

Nataraj
begin:vcard
fn:http://www.gsis.ac.in
n:S Narayan;Nataraj
org:Good Shepherd International School;Software
adr:Niligiris, ;;M.Palada;Ootacamund;TN;643004;INDIA
email;internet:[EMAIL PROTECTED]
title:Project Coordinator
tel;work:0423 2550371 - 307
x-mozilla-html:TRUE
url:http://www.gsis.ac.in
version:2.1
end:vcard



Re: [lazarus] SQLDB postgres

2006-06-04 Thread Bram Kuijvenhoven

Alex du Plessis wrote:
Would anybody know why a sqldb query (TSQLQuery) has a problem reading 
an aggregate field?  I cannot get the query to read an aggregate field 
for love or money.  It complanis that it cannot find the fieldname 
(query.FieldbyName('sum').asInteger) or that the 
index(query.Fields[i].asInteger) is out of range.


The query syntax is correct and i can read the result when running it in 
PGAdmin.


Still, I recommend you copy  paste the relevant parts of the code here! 
(Relevant is the code that assigns/builds the query up to the part that tries to 
read the Field.)

I haven't had any problems accessing aggregate fields with TSQLQuery (using 
TODBCConnection), and I consider it unlikely the PostGres component has a 
problem with this.

A few shots in the dark:
- does the code work with query.ParseSQL := false ?
- can it read the other fields from the query ?
- what is the content of the query just before the call to Execute (or what is 
in the logs of PostGres?)

Bram

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-11 Thread Michael Van Canneyt


On Sat, 11 Mar 2006 [EMAIL PROTECTED] wrote:

 Matt Henley wrote:
  I figured I would start a new topic on this.
  
  I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
  added a TIBConnection to a blank form.  I put the full path to an
  example database (C:\Program
  Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
  Field of the Object Inspector.  I left the host blank as well as
  UserName and Password  as I have not set any of these and the Firebird
  docs said they could be left blank.  When I try to set the object to
  active, I get a response that unavailable database.
  
  I must be missing something.  Is there a begineers tutorial on this
  component?   How would I set host for a database running in embedded
  mode and how do I set users and passwords, if needed?
  
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
  unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives
  
  
  
 Hi!
 I experimented with this setup. I mean Lazarus + sqldb + embedded firebird.
 All I can say it works.
 If I remember correctly, I had to rename fbembed.dll to fbclient.dll to make
 it work.

This is one possibility, if you have the latest FPC sources, just set

  UseEmbeddedFirebird:=True;

(declared in ibase60dyn)

 And maybe the password needs to be set.

AFAIR On Windows, you don't need a password. On Linux, you do.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-11 Thread Michael Van Canneyt


On Sat, 11 Mar 2006, Matthijs Willemstein wrote:

 On Fri, 2006-03-10 at 17:08 -0600, Matt Henley wrote:
  I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
  added a TIBConnection to a blank form.  I put the full path to an
  example database (C:\Program
  Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
  Field of the Object Inspector.  I left the host blank as well as
  UserName and Password  as I have not set any of these and the Firebird
  docs said they could be left blank.  When I try to set the object to
  active, I get a response that unavailable database.
 You should add the hostname (or ip) before the database name. So
 something like: 192.168.1.1:C\Program Files\etc

You can use 'localhost':

localhost:C\Program Files\e 

should be fine.

About the password, forget my previous remark, that was valid only for embedded 
firebird.
for Classic Server or Superserver you allways need a username/password pair.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-11 Thread Matt Henley
On 3/11/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:


 On Sat, 11 Mar 2006, Matthijs Willemstein wrote:

  On Fri, 2006-03-10 at 17:08 -0600, Matt Henley wrote:
   I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
   added a TIBConnection to a blank form.  I put the full path to an
   example database (C:\Program
   Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
   Field of the Object Inspector.  I left the host blank as well as
   UserName and Password  as I have not set any of these and the Firebird
   docs said they could be left blank.  When I try to set the object to
   active, I get a response that unavailable database.
  You should add the hostname (or ip) before the database name. So
  something like: 192.168.1.1:C\Program Files\etc

 You can use 'localhost':

 localhost:C\Program Files\e

 should be fine.

 About the password, forget my previous remark, that was valid only for 
 embedded firebird.
 for Classic Server or Superserver you allways need a username/password pair.


Can you tell me the difference between the Classic and the embedded? 
I am trying to use it as an embedded database for a program. Called as
a library or dll.  I do not want a server process running separately. 
I think I need to go find the firebird docs as i did not see anyway to
set a user or password.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-11 Thread Michael Van Canneyt


On Sat, 11 Mar 2006, Matt Henley wrote:

 On 3/11/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:
 
 
  On Sat, 11 Mar 2006, Matthijs Willemstein wrote:
 
   On Fri, 2006-03-10 at 17:08 -0600, Matt Henley wrote:
I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
added a TIBConnection to a blank form.  I put the full path to an
example database (C:\Program
Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
Field of the Object Inspector.  I left the host blank as well as
UserName and Password  as I have not set any of these and the Firebird
docs said they could be left blank.  When I try to set the object to
active, I get a response that unavailable database.
   You should add the hostname (or ip) before the database name. So
   something like: 192.168.1.1:C\Program Files\etc
 
  You can use 'localhost':
 
  localhost:C\Program Files\e
 
  should be fine.
 
  About the password, forget my previous remark, that was valid only for 
  embedded firebird.
  for Classic Server or Superserver you allways need a username/password pair.
 
 
 Can you tell me the difference between the Classic and the embedded? 

In classic, there is still a  separate server process running. 
Your application communicates with the server application to access the 
database.
For embedded, the application directly accesses the database file.

 I am trying to use it as an embedded database for a program. Called as
 a library or dll.

That is embedded.

 I do not want a server process running separately. 
 I think I need to go find the firebird docs as i did not see anyway to
 set a user or password.

I recommend to run a server process anyway for development purposes, 
this allows you to use a lot of tools such as IBadmin or FlameRobin, 
IBOConsole or whatever. With embedded, these tools don't work properly.

When deploying, then you can switch to embedded. For the actual code, 
there is no difference anway.

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-11 Thread Matt Henley
Sounds good.  I have noted a decided lack of documentation on the
embedded mode.  Just coming from an ascii text datafile and sqlite
background.  Its a bit confusing.  In their download area, they have
an embedded server download for windows but not for linux.  Will try
with classic although gentoo loads superserver through portage.

On 3/11/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:


 On Sat, 11 Mar 2006, Matt Henley wrote:

  On 3/11/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:
  
  
   On Sat, 11 Mar 2006, Matthijs Willemstein wrote:
  
On Fri, 2006-03-10 at 17:08 -0600, Matt Henley wrote:
 I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
 added a TIBConnection to a blank form.  I put the full path to an
 example database (C:\Program
 Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
 Field of the Object Inspector.  I left the host blank as well as
 UserName and Password  as I have not set any of these and the Firebird
 docs said they could be left blank.  When I try to set the object to
 active, I get a response that unavailable database.
You should add the hostname (or ip) before the database name. So
something like: 192.168.1.1:C\Program Files\etc
  
   You can use 'localhost':
  
   localhost:C\Program Files\e
  
   should be fine.
  
   About the password, forget my previous remark, that was valid only for 
   embedded firebird.
   for Classic Server or Superserver you allways need a username/password 
   pair.
  
 
  Can you tell me the difference between the Classic and the embedded?

 In classic, there is still a  separate server process running.
 Your application communicates with the server application to access the 
 database.
 For embedded, the application directly accesses the database file.

  I am trying to use it as an embedded database for a program. Called as
  a library or dll.

 That is embedded.

  I do not want a server process running separately.
  I think I need to go find the firebird docs as i did not see anyway to
  set a user or password.

 I recommend to run a server process anyway for development purposes,
 this allows you to use a lot of tools such as IBadmin or FlameRobin,
 IBOConsole or whatever. With embedded, these tools don't work properly.

 When deploying, then you can switch to embedded. For the actual code,
 there is no difference anway.

 Michael.

 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives


_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-10 Thread anteusz

Matt Henley wrote:

I figured I would start a new topic on this.

I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
added a TIBConnection to a blank form.  I put the full path to an
example database (C:\Program
Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
Field of the Object Inspector.  I left the host blank as well as
UserName and Password  as I have not set any of these and the Firebird
docs said they could be left blank.  When I try to set the object to
active, I get a response that unavailable database.

I must be missing something.  Is there a begineers tutorial on this
component?   How would I set host for a database running in embedded
mode and how do I set users and passwords, if needed?

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


  

Hi!
I experimented with this setup. I mean Lazarus + sqldb + embedded firebird.
All I can say it works.
If I remember correctly, I had to rename fbembed.dll to fbclient.dll to 
make it work.

And maybe the password needs to be set.

Márton Papp




_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SqlDB with Firebird

2006-03-10 Thread Matthijs Willemstein
On Fri, 2006-03-10 at 17:08 -0600, Matt Henley wrote:
 I installed Firebird Classic on my Windows XP machine.  In Lazarus, I
 added a TIBConnection to a blank form.  I put the full path to an
 example database (C:\Program
 Files\Firebird\Firebird_1_5\examples\EMPLOYEE.FDB)  in the Database
 Field of the Object Inspector.  I left the host blank as well as
 UserName and Password  as I have not set any of these and the Firebird
 docs said they could be left blank.  When I try to set the object to
 active, I get a response that unavailable database.
You should add the hostname (or ip) before the database name. So
something like: 192.168.1.1:C\Program Files\etc

Second you have to provide username and pasword. If not in design time
then during runtime.

Matthijs

-- 
Matthijs Willemstein [EMAIL PROTECTED]

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb

2006-03-03 Thread Michael Van Canneyt



On Fri, 3 Mar 2006, Bogus?aw Brandys wrote:


Hello,

Please ask FPC developers if they could add ErrorNumber to EDatabaseError 
exception to differentiate what was the cause of exception.It would be 
helpful for sqldb package also.


This should for example evaluate to GDSCODE for Interbase/Firebird and is 
more clever way to use in case...end inside on exception handler
Besides for example Firebird frequently return (string) error message which 
is concatenation of several errors (cascade error reporting)  - not good to 
compare.


While I understand why you want this:

The disadvantage of this is that you need to have a complete list of
error numbers and their meaning, and they should be the same accross
databases, which is not feasible.

The proper way of doing this is to create a descendent which contains the
error code.

Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb

2006-03-03 Thread Joost van der Sluis

 Please ask FPC developers if they could add ErrorNumber to 
 EDatabaseError exception to differentiate what was the cause of 
 exception.It would be helpful for sqldb package also.

There already is an bug-item for this. I'm too busy now. Next week i'll
answer to all sqldb/db-related issues on the mailinglists and try to
implement a better error-handling.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] sqldb

2006-03-03 Thread Marc Weustink

Michael Van Canneyt wrote:



On Fri, 3 Mar 2006, Bogus?aw Brandys wrote:


Hello,

Please ask FPC developers if they could add ErrorNumber to 
EDatabaseError exception to differentiate what was the cause of 
exception.It would be helpful for sqldb package also.


This should for example evaluate to GDSCODE for Interbase/Firebird and 
is more clever way to use in case...end inside on exception handler
Besides for example Firebird frequently return (string) error message 
which is concatenation of several errors (cascade error reporting)  - 
not good to compare.



While I understand why you want this:

The disadvantage of this is that you need to have a complete list of
error numbers and their meaning, and they should be the same accross
databases, which is not feasible.


I see no problem in this number reporting the error number from the 
underlying DB. We don't have unified errormessages either.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb bug

2006-02-06 Thread Bram Kuijvenhoven

Alexander Todorov wrote:

I am using SQLdb 1.0 / Lazarus 0.9.8 / FPC 2.0.1 on Windows XP with
Firebird 1.5 database.
When a statement like
INSERT INTO TEST (ID, DATAFIELD) VALUES (1, 'this :is a :test') is
executed i get an error.
The problem is that values after the colon ':' characters are parsed
as parameters. In my particular case FSQLQuery.Params.Count was 2.


Joost, does the Firebird implementation use TParams.ParseSQL? I checked ('my') 
code in ParseSQL, and it should work. Perhaps TIBConnection does some manual 
scanning for : characters too?

Regards,

Bram

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb bug

2006-02-06 Thread Joost van der Sluis
  I am using lates Lazarus version (0.9.11) and this insert statement run OK.
  You can try set Dataset.ParseSQL := False; before any Dataset.ExecSQL or
  Dataset.Open
 
 
 Nevertheless it is a bug. 

Yep, it's bug 4374 and it was fixed in november last year.

 There should be no parsing inside string constants in the SQL statement.

 Alexander Todorov, Can you please submit this in the FPC (not Lazarus) 
 bugtracker,
 so it won't be forgotten ?

Or better, update your copy of fpc. 2.0.2 and later doesn't have this
problem.

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb bug

2006-02-06 Thread Joost van der Sluis
On Mon, 2006-02-06 at 09:04 +0100, Bram Kuijvenhoven wrote:
 Alexander Todorov wrote:
  I am using SQLdb 1.0 / Lazarus 0.9.8 / FPC 2.0.1 on Windows XP with
  Firebird 1.5 database.
  When a statement like
  INSERT INTO TEST (ID, DATAFIELD) VALUES (1, 'this :is a :test') is
  executed i get an error.
  The problem is that values after the colon ':' characters are parsed
  as parameters. In my particular case FSQLQuery.Params.Count was 2.
 
 Joost, does the Firebird implementation use TParams.ParseSQL? I checked 
 ('my') code in ParseSQL, and it should work. Perhaps TIBConnection does some 
 manual scanning for : characters too?

Yes it does. But it didn't in the version he was using. The bug was
fixed in november with your code.

Joost.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb bug

2006-02-05 Thread Dan

I am using lates Lazarus version (0.9.11) and this insert statement run OK.
You can try set Dataset.ParseSQL := False; before any Dataset.ExecSQL or 
Dataset.Open


Dan

- Original Message - 
From: Alexander Todorov [EMAIL PROTECTED]

To: lazarus@miraclec.com
Sent: Sunday, February 05, 2006 8:23 PM
Subject: [lazarus] SQLdb bug



Good evening,
I am using SQLdb 1.0 / Lazarus 0.9.8 / FPC 2.0.1 on Windows XP with
Firebird 1.5 database.
When a statement like
INSERT INTO TEST (ID, DATAFIELD) VALUES (1, 'this :is a :test') is
executed i get an error.
The problem is that values after the colon ':' characters are parsed
as parameters. In my particular case FSQLQuery.Params.Count was 2.

Should I create a test project and report it, or it is solved with
newer version ?
Can anyone confirm that with other database servers?

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives 


_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLdb bug

2006-02-05 Thread Michael Van Canneyt


On Sun, 5 Feb 2006, Dan wrote:

 I am using lates Lazarus version (0.9.11) and this insert statement run OK.
 You can try set Dataset.ParseSQL := False; before any Dataset.ExecSQL or
 Dataset.Open


Nevertheless it is a bug. 
There should be no parsing inside string constants in the SQL statement.

Alexander Todorov, Can you please submit this in the FPC (not Lazarus) 
bugtracker,
so it won't be forgotten ?

Michael.
 
 - Original Message - From: Alexander Todorov
 [EMAIL PROTECTED]
 To: lazarus@miraclec.com
 Sent: Sunday, February 05, 2006 8:23 PM
 Subject: [lazarus] SQLdb bug
 
 
  Good evening,
  I am using SQLdb 1.0 / Lazarus 0.9.8 / FPC 2.0.1 on Windows XP with
  Firebird 1.5 database.
  When a statement like
  INSERT INTO TEST (ID, DATAFIELD) VALUES (1, 'this :is a :test') is
  executed i get an error.
  The problem is that values after the colon ':' characters are parsed
  as parameters. In my particular case FSQLQuery.Params.Count was 2.
  
  Should I create a test project and report it, or it is solved with
  newer version ?
  Can anyone confirm that with other database servers?
  
  _
  To unsubscribe: mail [EMAIL PROTECTED] with
  unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives 
 
 _
 To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
 archives at http://www.lazarus.freepascal.org/mailarchives
 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB support MySQL v4.0, v4.1 and v5.1

2005-11-23 Thread Joost van der Sluis
  the attachment enables the TMySQL40Connection, TMySQL41Connection and
  TMySQL50Connection components in the SQLDB package for fpc-version
  2.1.1.

  Thanks, applied in revision 8112.
  When will it be merged to 2.0.3?

 Depends on Joost :)

I first want to test if it compiles and works on Windows, and if the
snapshots are ok. 

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] SQLDB support MySQL v4.0, v4.1 and v5.1

2005-11-22 Thread Vincent Snijders

Joost van der Sluis wrote:

Hi all,

the attachment enables the TMySQL40Connection, TMySQL41Connection and
TMySQL50Connection components in the SQLDB package for fpc-version
2.1.1.


Thanks, applied in revision 8112.

When will it be merged to 2.0.3?

Vincent.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives