Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2010-01

ODBC

13 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thomas Nelson

All,

I seem to have come across a minor problem and don’t know how to fix it.

Utilizing the \examples\odbc\testodbc.pp module with FPC 2.2.4 everything compiles fine

When I upgraded to FPC 2.4.0 I get an error message (please see attached screen shot)

Which says “Import Library not found for ODBC” – this results in a fatal error.

This is on Windows XP system

After doing the basic compiler install, I updated that with the base_w32_v24.zip file (for the rtl) and the fpc.2.4.1.i386-win32.zip to get the latest updates.

I am sure I missed something somewhere, can you point me in the proper direction – have I missed something somewhere?

Thanks for all your help

Tom

Thomas Nelson
Director Information Technology, Information Systems CoxHealth

Phone: (417) 269-8961
Mobile: (417) 459-3528
Fax: (417) 269-2133

CoxHealth – a Top 100 Integrated Health Care Network CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

Reply by email

Thomas Nelson

I will try again without the screenshot - thanks

All,

I seem to have come across a minor problem and don’t know how to fix it.

Utilizing the \examples\odbc\testodbc.pp module with FPC 2.2.4 everything compiles fine

When I upgraded to FPC 2.4.0 I get an error message which says “Import Library not found for ODBC” – this results in a fatal error.

This happens with the example supplied with the FPC 2.4.0 release => /fpc/examples/odbc/testodbc.pp

This is on Windows XP system

After doing the basic compiler install, I updated that with the base_w32_v24.zip file (for the rtl) and the fpc.2.4.1.i386-win32.zip to get the latest updates.

I am sure I missed something somewhere, can you point me in the proper direction – have I missed something somewhere?

Thanks for all your help

Tom

Thomas Nelson
Director Information Technology, Information Systems CoxHealth

Phone: (417) 269-8961
Mobile: (417) 459-3528
Fax: (417) 269-2133

CoxHealth – a Top 100 Integrated Health Care Network CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

Reply by email

Leonardo M. Ramé
to Thomas Nelson

I'm using fcl-xml to parse a XML data from a TMemoryStream/TStringStream and noted it can parse streams with a maximum capacity of 4096 bytes, why can't it receive bigger streams?.

The maximum capacity is defined in the constructor of TXMLStreamInputSource, in XMLRead.pp.

-------------------------------
constructor TXMLStreamInputSource.Create(AStream: TStream; AOwnStream: Boolean);
begin
  FStream := AStream;
  FCapacity := 4096; <-- here's the max capacity allowed
  ...
-------------------------------

My testing code is this:

var
  lDoc: TXMLDocument;
  lStr: TStringStream;
begin
  lStr := TStringStream.Create(Memo1.Text);
  lDoc := TXMLDocument.Create;
  try
    ReadXMLFile(lDoc, lStr);
  finally
    lDoc.Free;
    lStr.Free;
  end;
end.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Reply by email

Sergei Gorelkin
to Leonardo M. Ramé
Leonardo M. Ramé wrote
I'm using fcl-xml to parse a XML data from a TMemoryStream/TStringStream and noted it can parse streams with a maximum capacity of 4096 bytes, why can't it receive bigger streams?. The maximum capacity is defined in the constructor of TXMLStreamInputSource, in XMLRead.pp.

This value has nothing to do with total possible stream size, it is only the size of buffer used while reading.
The maximum size of XML data that can be read with DOM on a 32-bit machine is about 40 to 150 MBytes (depending on the data structure).

Sergei

Reply by email

Leonardo M. Ramé

Thanks Sergey.

I tought that was why my program was stopping with an assertion in procedure TNodePool.AddExtent of dom.pp, the assertion dissapears when I work with smaller XML files.

BTW: the file worked with older versions of fcl-xml, now I'm using the trunk version because it no longer deppends on AVL_Tree, that wasn'n thread safe.

I attached the file I'm using for testing.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Sergei Gorelkin wrote 24 lines
From: Sergei Gorelkin Subject: Re: [fpc-devel] XML Stream capacity To: "FPC developers' list" Date: Thursday, January 14, 2010, 12:51 PM Leonardo M. Ramé wrote: > I'm using fcl-xml to parse a XML data from a TMemoryStream/TStringStream and noted it can parse streams with a maximum capacity of 4096 bytes, why can't it receive bigger streams?. > > The maximum capacity is defined in the constructor of TXMLStreamInputSource, in XMLRead.pp. > This value has nothing to do with total possible stream size, it is only the size of buffer used while reading. The maximum size of XML data that can be read with DOM on a 32-bit machine is about 40 to 150 MBytes (depending on the data structure). Sergei _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jonas Maebe
to Thomas Nelson: I seem to have come across a minor problem and don’t know how to fix it. Utilizing the…
Thomas Nelson wrote 7 lines
I seem to have come across a minor problem and don’t know how to fix it. Utilizing the \examples\odbc\testodbc.pp module with FPC 2.2.4 everything compiles fine When I upgraded to FPC 2.4.0 I get an error message (please see attached screen shot) Which says “Import Library not found for ODBC” – this results in a fatal error.

Try using the odbcsqldyn unit instead of the odbcsql unit. In r13495, a {$linklib odbc} statement was added for the latter unit, which presumably requires the presence of an import library on Windows.

Jonas

Reply by email

Michael Van Canneyt
to Jonas Maebe
Jonas Maebe wrote 12 lines
On 12 Jan 2010, at 19:12, Thomas Nelson wrote: > I seem to have come across a minor problem and don’t know how to fix it. > > Utilizing the \examples\odbc\testodbc.pp module with FPC 2.2.4 everything compiles fine > > When I upgraded to FPC 2.4.0 I get an error message (please see attached screen shot) > > Which says “Import Library not found for ODBC” – this results in a fatal error. Try using the odbcsqldyn unit instead of the odbcsql unit. In r13495, a {$linklib odbc} statement was added for the latter unit, which presumably requires the presence of an import library on Windows.

Indeed.

If you do, do not forget to call

   InitialiseODBC;

before you do anything ODBC related.

Michael.

Reply by email

Sergei Gorelkin
to Leonardo M. Ramé: Thanks Sergey. I tought that was why my program was stopping with an assertion in…
Leonardo M. Ramé wrote 8 lines
Thanks Sergey. I tought that was why my program was stopping with an assertion in procedure TNodePool.AddExtent of dom.pp, the assertion dissapears when I work with smaller XML files. BTW: the file worked with older versions of fcl-xml, now I'm using the trunk version because it no longer deppends on AVL_Tree, that wasn'n thread safe. I attached the file I'm using for testing.

Does r14644 solve the problem?

Sergei

Reply by email

Leonardo M. Ramé
to Sergei Gorelkin

Yes!, thank you very much Sergei.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Sergei Gorelkin wrote 25 lines
From: Sergei Gorelkin Subject: Re: [fpc-devel] XML Stream capacity To: "FPC developers' list" Date: Thursday, January 14, 2010, 2:24 PM Leonardo M. Ramé wrote: > Thanks Sergey. > > I tought that was why my program was stopping with an assertion in procedure TNodePool.AddExtent of dom.pp, the assertion dissapears when I work with smaller XML files. > > BTW: the file worked with older versions of fcl-xml, now I'm using the trunk version because it no longer deppends on AVL_Tree, that wasn'n thread safe. > > I attached the file I'm using for testing. > Does r14644 solve the problem? Sergei _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Thomas Nelson

Thank you all very much –

Making the changes you suggested fixed my problems.

Back to work now :)

Thomas Nelson
Director Information Technology, Information Systems CoxHealth

Phone: (417) 269-8961
Mobile: (417) 459-3528
Fax: (417) 269-2133

CoxHealth – a Top 100 Integrated Health Care Network CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

_____________________________________________

Earlier message 33 lines
From: Thomas Nelson Sent: Tuesday, January 12, 2010 13:13 To: '' Subject: ODBC All, I seem to have come across a minor problem and don’t know how to fix it. Utilizing the \examples\odbc\testodbc.pp module with FPC 2.2.4 everything compiles fine When I upgraded to FPC 2.4.0 I get an error message (please see attached screen shot) Which says “Import Library not found for ODBC” – this results in a fatal error. This is on Windows XP system After doing the basic compiler install, I updated that with the base_w32_v24.zip file (for the rtl) and the fpc.2.4.1.i386-win32.zip to get the latest updates. I am sure I missed something somewhere, can you point me in the proper direction – have I missed something somewhere? << OLE Object: Picture (Device Independent Bitmap) >> Thanks for all your help Tom

Reply by email

Leonardo M. Ramé
to Leonardo M. Ramé

Sorry, I found it now checks the encoding of the XML file. To accept spanish accented chars, I had to include <?xml version="1.0" encoding="iso-8859-1"?> and it worked ok.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Leonardo M. Ramé wrote 20 lines
From: Leonardo M. Ramé Subject: [fpc-devel] New issue in fcl-xml To: "FPC developers' list" Date: Friday, January 15, 2010, 12:47 PM When the XML file includes accented characters, an "Invalid character in input stream" exception is raised. Is this correct?, how should I include accented chars in an XML file?. Leonardo M. Ramé http://leonardorame.blogspot.com _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Sergei Gorelkin
to Leonardo M. Ramé
Leonardo M. Ramé wrote
Sorry, I found it now checks the encoding of the XML file. To accept spanish accented chars, I had to include <?xml version="1.0" encoding="iso-8859-1"?> and it worked ok.

The iso-8859-1, utf-8 and utf-16 are the only encodings handled 'natively' (by the XMLRead unit). Any encoding not from this list must be handled by an external decoder. Should you ever face this, refer to http://wiki.freepascal.org/XML_Decoders for details.

Sergei

Reply by email