[fpc-pascal]Creating database with SQLiteDataset

2004-03-22 Thread Milos Pejovic
Hi all,

I was trying to adapt TDbf table creation demo to SQLiteDataset, but I 
get this error:

An unhandled exception occurred at 0x080557E4 :
EDatabaseError :  : Dataset is read-only.
 0x080557E4
 0x0050
I have no idea how to put the DataSet in read/write mode...

fpc 1.9.2 linux
sqlite library 2.8.13
Cheers,
Milos
{$linklib c}

program sqlitetest;

{$mode objfpc}{$H+}

uses
  SysUtils, Classes, db, SQLiteDataset;
  
var
  Sqlite: TSqlite;
  f1, f2: TField;
  df: TDateField;
  dtf: TDateTimeField;
  i: integer;

begin
  Sqlite := TSQLite.create(nil);
  with Sqlite do begin
   Close;
   DataBase := ExtractFilePath(ParamStr(0)) + 'base1.db';
   TableName := 'table1';
// Method 1
with FieldDefs do begin
  Clear;
  Add('Field1',ftString,10,False);
  Add('Field2',ftInteger,0,False);
  //Add('Address',ftMemo,0,False);
  Add('DateTime', ftDateTime, 0, False);
  Add('Date',ftDate,0,False);
end;
   CreateTable;
   Open;
  end;
  f1:=Sqlite.FindField('Field1');
  f2:=Sqlite.FindField('Field2');
  df:=TDateField(Sqlite.FindField('Date'));
  dtf:=TDateTimeField(Sqlite.FindField('DateTime'));

  for i:=0 to 100 do begin
Sqlite.Append;
f1.AsString:=
  chr((i * 1 + 4)  mod 26 + 65)+
  chr((i * 2 + 5)  mod 26 + 65)+
  chr((i * 3 + 6)  mod 26 + 65);
f2.AsLongint := i;
df.AsDateTime := date;
dtf.Value := Now;
Sqlite.Post;
  end;
  Sqlite.Close;
  Sqlite.Free;
end.



Re: [fpc-pascal]constant longword problem

2004-03-22 Thread Marc Santhoff
Am So, den 21.03.2004 schrieb Marco van de Voort um 15:58:
> > > >
> > > >Compiling usb_h.pp
> > > >Assembling usb_h
> > > >45 Lines compiled, 0.0 sec
> > > 
> > > Constants > maxlongint are not supported in 1.0.x. You need to use 1.9.x
> > 
> > Ah, I see.

Thanks, I know from your earlier posting, but i can't switch at the
moment and writing one C-function and linking the .o in is already here.
;)

Bye,
Marc



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Creating database with SQLiteDataset

2004-03-22 Thread Michael Van Canneyt


On Mon, 22 Mar 2004, Milos Pejovic wrote:

> Hi all,
>
> I was trying to adapt TDbf table creation demo to SQLiteDataset, but I
> get this error:
>
> An unhandled exception occurred at 0x080557E4 :
> EDatabaseError :  : Dataset is read-only.
>   0x080557E4
>   0x0050
>
> I have no idea how to put the DataSet in read/write mode...

The SQLIte dataset is read-only, it cannot be put in read/write mode.

Michael.

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]high performance counter for dos/tp7

2004-03-22 Thread Thomas Schatzl
Hello,

>
> But ehm... it seems your website is locked... unable to view/download code
> etc :)
>
> I thought I'd let you know just in case you forgot to unlock it =D

No, this is a public website and I checked the URL I gave you, it works fine
from my place. Same goes for the links to the sources, none of them is
broken.

Regards,
  Thomas


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]version differences

2004-03-22 Thread Pápai András

> I don't know what the reason is, but I suspect the large_integer (64
bits).
> In each case, using 1.9.X, your sources didn't compile at all.
> I changed them and now the program works correctly as far as I can
> see (at least, it reports no error).
> 
> Michael.

The source you sent doesn't compile with 1.0.10:
test.pas(20,49) Error: Incompatible type for arg no. 3: Got INT64, expected
PLUID
test.pas(25,27) Error: Incompatible types: got "INT64" expected
"LARGE_INTEGER"
test.pas(33) Fatal: There were 2 errors compiling module, stopping

(1)
I added the typecasts, uncommented the ExitWindowsEx line, then could
compile it.
But didn't work.

There is no error message: AdjustTokenPrivileges() returns TRUE, assuming no
error, but GetLastError still returns error 1300.


(2)
I tried using variables with absolute address:

var
  luid_LUID: LUID absolute Shutdown_LUID;
  large_LUID: large_integer absolute Shutdown_LUID;

This compiles, too and runs with the same results. :-(

And the best: both compile and run with 1.0.4!

I'll analise the generated assembly source, to find something.

Andras



Ezen uzenet es annak barmely csatolt anyaga bizalmas, jogi vedelem alatt all, a 
nyilvanos kozlestol vedett.
Az uzenetet kizarolag a cimzett, illetve az altala meghatalmazottak hasznalhatjak fel. 
Ha On nem az uzenet cimzettje, ugy kerjuk, hogy telefonon, vagy e-mail-ben ertesitse 
errol az uzenet kuldojet es torolje az uzenetet, 
valamint annak osszes csatolt mellekletet a rendszerebol. Ha On nem az uzenet 
cimzettje, abban az esetben tilos az 
uzenetet vagy annak barmely csatolt mellekletet lemasolnia, elmentenie, az uzenet 
tartalmat barkivel kozolnie 
vagy azzal visszaelnie.


This message and any attachment are confidential and are legally privileged. It is 
intended solely for the use of 
the individual or entity to whom it is addressed and others authorised to receive it. 
If you are not the intended 
recipient, please telephone or email the sender and delete this message and any 
attachment from your system. 
Please note that any dissemination, distribution, copying or use of or reliance upon 
the information contained in 
and transmitted with this e-mail by or to anyone other than the recipient designated 
above by the sender is 
unauthorised and strictly prohibited.



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]version differences

2004-03-22 Thread Peter Vreman
>
>> I don't know what the reason is, but I suspect the large_integer (64
> bits).
>> In each case, using 1.9.X, your sources didn't compile at all.
>> I changed them and now the program works correctly as far as I can
>> see (at least, it reports no error).
>>
>> Michael.
>
> The source you sent doesn't compile with 1.0.10:
> test.pas(20,49) Error: Incompatible type for arg no. 3: Got INT64,
> expected
> PLUID
> test.pas(25,27) Error: Incompatible types: got "INT64" expected
> "LARGE_INTEGER"
> test.pas(33) Fatal: There were 2 errors compiling module, stopping



> And the best: both compile and run with 1.0.4!

If the code compiles and works with 1.9.x than the bug is solved. It
doesn't matter that 1.0.10 has a problem. We will not fix it in 1.0.x. The
future and current development is 1.9.x only.

Peter



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]high performance counter for dos/tp7

2004-03-22 Thread Harald Houppermans

- Original Message - 
From: "Thomas Schatzl" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 12:47 PM
Subject: Re: [fpc-pascal]high performance counter for dos/tp7


> Hello,
>
> >
> > But ehm... it seems your website is locked... unable to view/download
code
> > etc :)
> >
> > I thought I'd let you know just in case you forgot to unlock it =D
>
> No, this is a public website and I checked the URL I gave you, it works
fine
> from my place. Same goes for the links to the sources, none of them is
> broken.

Indeed, I installed a new version of zone alarm pro and set mobile code
control to on.

That apparently blocked me from downloading.

>
> Regards,
>   Thomas
>
>
> ___
> fpc-pascal maillist  -  [EMAIL PROTECTED]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal