Forum > General
Unable to Query the ODBC connection data in Free Pascal Lazarus IDE V3.4
(1/1)
AnkitKastwal:
I am currently trying to integrate the ODBC component within the Free Pascal Lazarus IDE version 3.4. While doing this the connection test is successful, but I encounter an error when executing queries. The error message states, "Error executing query: Transaction not set". I have tried to address this issue by creating a transaction component, but the problem persists. Additionally, I have encountered another issue that I have not yet been able to resolve, which is preventing the successful execution of queries
Could you please provide guidance on how to resolve this issue so that I can successfully query and preview data in the Free Pascal Lazarus IDE?
Please find the attached detailed steps that I have followed to achieve this
Zvoni:
Read the correct "how-to".... https://wiki.freepascal.org/SQLdb_Package
--- Quote --- Make sure you have the relevant database client/driver installed.
Go to the SQLdb tab in Component Palette.
Add a TXXXConnection component (suitable for the type of database you are using) to a form, and fill in the appropriate properties to connect to your database. These will vary depending on the actual database. Make sure you can set the "connected" property to true.
Add a TSQLTransaction component. Return to the Connection component, and set its Transaction Property to the new transaction. This should also set the transaction's database property. You should be able to set active to true.
Add an SQLQuery component and set its Database property to the connecton component you just added.
Set the SQLQuery "SQL" property. For a first test, just do a "select * from <tablename>".
Set active to true. If this works, you have opened your query, and the data is available.
--- End quote ---
Thaddy:
One further important thing to note that if you happen to compile for 64 bit, there are very very few 64 bit ODBC drivers and the only one that is reliable is the one for ms sqlserver. ODBC firmly lives in the land of 32 bit.
Oracle also has a 64 bit driver as part of ODAC, but I think that has a licensing issue. There is also one from CDATA it seems, but I am not familiar with that.
Navigation
[0] Message Index