* * *

Author Topic: Lazarus and MDB  (Read 3162 times)

Adriano_sousa

  • New member
  • *
  • Posts: 13
Lazarus and MDB
« on: May 06, 2018, 07:11:08 pm »

Hello friends ..
I'm getting this error in my Query:
Could not execute statement.ODBC error details:
LastReturnCode: SQL_ERROR: Record1: SqlState: 08001; Nativeerror: 1; message: Could not parse SQl.
the connection is lazarus linux and MDB ...
thank you.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 797
    • Burdjia
Re: Lazarus and MDB
« Reply #1 on: May 07, 2018, 10:29:51 am »
Without code is hard to guess.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

RayoGlauco

  • Jr. Member
  • **
  • Posts: 76
  • Beers: 1567
Re: Lazarus and MDB
« Reply #2 on: May 07, 2018, 12:40:16 pm »
Your error is "Could not parse SQL", thant means your SQL command was not understood. There may be a syntax error, or maybe a string codification issue (UTF8 string when an UTF16 string was expected?).

To err is human, but to really mess things up, you need a computer.

Adriano_sousa

  • New member
  • *
  • Posts: 13
Re: Lazarus and MDB
« Reply #3 on: May 07, 2018, 07:23:17 pm »

Good afternoon folks..
In my sqlquery it looks like this:

Select * from myTable

nothing more...
this utf8 coding
Where does it change?

I put Parce as false
and the primary key is false as well ..
.
Thank you for helping me ...

JanRoza

  • Hero Member
  • *****
  • Posts: 500
    • http://www.silentwings.nl
Re: Lazarus and MDB
« Reply #4 on: May 07, 2018, 10:55:53 pm »
By showing a single line of sql code nobody can tell you what's wrong. Show your program code if you want help, or make a small demo project which gives the same error and show that here. Now all we can do is guess.
OS: Windows 10 (64 bit)
Laz: Lazarus 1.8.4 FPC 3.0.4 i386-win32-win32/win64

Adriano_sousa

  • New member
  • *
  • Posts: 13
Re: Lazarus and MDB
« Reply #5 on: May 08, 2018, 12:16:12 am »
Sorry .. maybe I'm not expressing right ....
I have always used Delphi ... now I am studying Lazarus linux and mdb ....
Commuita fight I managed to connect my ODBC in MDB ...
So:
I connected the ODBCConection to the Database, an SQLTransaction bound in ODBC, and a
and put a SQLquery ...
in SQLQUERY in the SQL field I put:

Select NAME from CADCASTROCLIENTE

E in ParseSQl = false
and in the UsePrimaryKeyAskey = false

when I give active = true in SQLQuery it writes the error:

Could not get updatable attribute for column1.
ODBC error details: LastReturnCode: SQL_ERROR;

and has this tb:
Could not retrieve primary key metadata for table CADCASTROCLIENTE
 using SQLPrimaryKeys. ODBC error details: LastReturnCode: SQL_ERROR;
Record 1: SqlState: IM001; NativeError: 0; Message:
 [unixODBC] [Driver Manager] Driver does not support this function;

When I try to connect through SQL Editing in ABA Result

Adriano_sousa

  • New member
  • *
  • Posts: 13
Re: Lazarus and MDB
« Reply #6 on: May 10, 2018, 05:25:06 pm »
no one ?
please.. :D

Handoko

  • Hero Member
  • *****
  • Posts: 2456
  • My goal: build my own game engine using Lazarus
Re: Lazarus and MDB
« Reply #7 on: May 10, 2018, 05:34:30 pm »
Please provide the compilable source code that we can compile, run and test. Programmers communicate better using source code, not 'common' languages.

To do it:
Copy all necessary files (including the database) to a new folder, except *.bak, *.exe, lib folder. Compress the folder and send the zip file to this forum.

If you're not willing to publicize your source code, you can write a demo example that showing that issue.

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 418
Re: Lazarus and MDB
« Reply #8 on: May 10, 2018, 06:59:43 pm »
I have explained to him in Portuguese what he needs to do to be more efficiently in getting some help:
http://forum.lazarus.freepascal.org/index.php/topic,41194.msg285588

af0815

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and MDB
« Reply #9 on: May 10, 2018, 09:09:23 pm »

Record 1: SqlState: IM001; NativeError: 0; Message:
 [unixODBC] [Driver Manager] Driver does not support this function;

One question -> are you using linux with odbc for access to mdb? Is the Datamanager (see http://www.unixodbc.org/doc/UserManual/ ) working with the statement ?

unixodbc or easysoft - odbc ? I have only seen, it should work only with the easysoft-odbc ( https://www.easysoft.com/products/data_access/odbc-access-driver/index.html#section=tab-1 ).
« Last Edit: May 10, 2018, 09:18:06 pm by af0815 »
regards
Andreas

Adriano_sousa

  • New member
  • *
  • Posts: 13
Re: Lazarus and MDB
« Reply #10 on: May 11, 2018, 01:41:06 am »

It's what I have, I'm studying ... I hope it works now



https://drive.google.com/file/d/1GINwuxfLRPq4MGklhytyhro91ghEtfkN/view?usp=sharing


obrigado

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 418
Re: Lazarus and MDB
« Reply #11 on: May 11, 2018, 07:51:47 am »
@Adriano_sousa

Have you studied the content below?
http://wiki.freepascal.org/ODBCConn

http://wiki.freepascal.org/MS_Access

Problem connecting to a MS Access Database with ODBC
http://forum.lazarus.freepascal.org/index.php?topic=8115.0

ODBC-connection to access DB with password
http://forum.lazarus-ide.org/index.php?topic=10202.0


Why do you need zcomponent on this small sample project?

Why don't you use a DSN-less connection?
http://wiki.freepascal.org/ODBCConn#DSN-less

Adriano_sousa

  • New member
  • *
  • Posts: 13
Re: Lazarus and MDB
« Reply #12 on: May 12, 2018, 01:38:18 am »
Good evening.
Foz a video to understand better

https://drive.google.com/file/d/1UtRl7utyqbjAfNUOQoAIj_nFvtWAyG-J/view?usp=sharing


Remembering that I use Lazarus linux thanks

Adriano_sousa

  • New member
  • *
  • Posts: 13
Re: Lazarus and MDB
« Reply #13 on: May 13, 2018, 05:33:20 am »
Can you help me now ... I have this project in Lazarus windows, and I wanted to make it multiplatform ... but in Linux it is difficult ... I hope you have the collaboration of voices

af0815

  • Full Member
  • ***
  • Posts: 153
Re: Lazarus and MDB
« Reply #14 on: May 13, 2018, 08:20:54 pm »
This seems not to be a limitation of Lazarus, it semis to be a limitation of the used odbc drivers in Linux.
regards
Andreas

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus