Sign in Join

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

Mailing lists / lazarus / 2012-11

ODBC-problems

12 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Koenraad Lelong

Hi,

I'm trying to use a Pervasive-database via ODBC. In Lazarus, I seem unable to set up the connection so I first tried with a Firebird connection. There also I have problems.
In Windows' ODBC-configuration-appication I made a user DSN to the Firebird server. Testing gives OK.
Trying to contact it via lazarus gives is OK.
Then I tried to do the same with a system DSN. There I have a problem, see the image.
I tried to do the same with the Pervasive driver, but there I have the problem for both user-DSN and system DSN.

Am I doing something wrong ?

Thanks for any help,

Koenraad Lelong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: odbc-err-FB System.png
Type: image/png
Size: 11547 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20121120/bafc3934/attachment-0001.png>

Reply by email

Unknown author
to Koenraad Lelong
Koenraad Lelong wrote 14 lines
Hi, I'm trying to use a Pervasive-database via ODBC. In Lazarus, I seem unable to set up the connection so I first tried with a Firebird connection. There also I have problems. In Windows' ODBC-configuration-appication I made a user DSN to the Firebird server. Testing gives OK. Trying to contact it via lazarus gives is OK. Then I tried to do the same with a system DSN. There I have a problem, see the image. I tried to do the same with the Pervasive driver, but there I have the problem for both user-DSN and system DSN. Am I doing something wrong ?

Is this on a 64-bit system ? And if so, are you programming 32-bit or 64-bit?

Michael.

Reply by email

Koenraad Lelong
to Unknown author

...

Is this on a 64-bit system ? And if so, are you programming 32-bit or 64-bit? Michael.

I'm programming on a 64bit Win7 system. AFAIK Lazarus is 32 bit (because the apps should run also on 32 bit systems, and they do).

I tried some things. I made a test-program that accepts a DSN-name and then tries to connect to that DSN.
In Win7 64 bit only the system DSN of Firebird works. On WinXP 32 bit everything works fine, Firebird system and user DSN and Pervasive system and user DSN.

Is this a known problem ?

Regards,

Koenraad Lelong.

Reply by email

Reinier Olislagers
to Koenraad Lelong
Koenraad Lelong wrote 5 lines
On 20-11-12 12:13, Koenraad Lelong wrote: > In Win7 64 bit only the system DSN of Firebird works. > Sorry, should be user DSN works, system DSN does not work.

As you're using 32 bit Lazarus, just to be sure:

please confirm the DSNs you are using are defined in the 32 bit ODBC control panel (using 32 bit Firebird ODBC drivers), not the 64 bit ones... That error message seems to indicate some bitness mismatch between applicationODBCODBC driver

Reply by email

Unknown author
to Reinier Olislagers
Reinier Olislagers wrote 12 lines
On 20-11-2012 12:23, Koenraad Lelong wrote: > On 20-11-12 12:13, Koenraad Lelong wrote: >> In Win7 64 bit only the system DSN of Firebird works. >> > Sorry, should be user DSN works, system DSN does not work. > As you're using 32 bit Lazarus, just to be sure: please confirm the DSNs you are using are defined in the 32 bit ODBC control panel (using 32 bit Firebird ODBC drivers), not the 64 bit ones... That error message seems to indicate some bitness mismatch between applicationODBCODBC driver

That's what I wanted to establish. I think it is a problem of 32/64 bit mismatch, it is not the first time I encounter this on Windows 64-bit. :-)

The best solution IMHO is to work fully in 64-bit: Firebird
Lazarus
Windows.
and not to attempt mixing things.

Michael.

Reply by email

Reinier Olislagers
to Unknown author
Show quoted text 16 lines
On Tue, 20 Nov 2012, Reinier Olislagers wrote: > On 20-11-2012 12:23, Koenraad Lelong wrote: >> On 20-11-12 12:13, Koenraad Lelong wrote: >>> In Win7 64 bit only the system DSN of Firebird works. >>> >> Sorry, should be user DSN works, system DSN does not work. >> > As you're using 32 bit Lazarus, just to be sure: > > please confirm the DSNs you are using are defined in the 32 bit ODBC > control panel (using 32 bit Firebird ODBC drivers), not the 64 bit > ones... > That error message seems to indicate some bitness mismatch between > applicationODBCODBC driver That's what I wanted to establish.

Yep, thought so when you wrote that post ;)

Show quoted text 5 lines
The best solution IMHO is to work fully in 64-bit: Firebird Lazarus Windows. and not to attempt mixing things.

Well... I'd say: even on Win64, keeping
Firebird
Lazarus
32 bit is better (unless memory etc requires 64 bit compilation) as 64 bit embedded Firebird on Win64 will give
- unexpected exceptions or
- just won't work (http://bugs.freepascal.org/view.php?id=21581) Those can be fixed with Sergei's SEH build (-dTEST_WIN64_SEH) though.

Reinier

Reply by email

Unknown author
to Reinier Olislagers
Reinier Olislagers wrote 33 lines
On 20-11-2012 13:40, wrote: > On Tue, 20 Nov 2012, Reinier Olislagers wrote: >> On 20-11-2012 12:23, Koenraad Lelong wrote: >>> On 20-11-12 12:13, Koenraad Lelong wrote: >>>> In Win7 64 bit only the system DSN of Firebird works. >>>> >>> Sorry, should be user DSN works, system DSN does not work. >>> >> As you're using 32 bit Lazarus, just to be sure: >> >> please confirm the DSNs you are using are defined in the 32 bit ODBC >> control panel (using 32 bit Firebird ODBC drivers), not the 64 bit >> ones... >> That error message seems to indicate some bitness mismatch between >> applicationODBCODBC driver > > That's what I wanted to establish. Yep, thought so when you wrote that post ;) > The best solution IMHO is to work fully in 64-bit: > Firebird > Lazarus > Windows. > and not to attempt mixing things. Well... I'd say: even on Win64, keeping Firebird Lazarus 32 bit is better (unless memory etc requires 64 bit compilation) as 64 bit embedded Firebird on Win64 will give - unexpected exceptions or - just won't work (http://bugs.freepascal.org/view.php?id=21581) Those can be fixed with Sergei's SEH build (-dTEST_WIN64_SEH) though.

The problem is not so much Lazarus, but ODBC. We've had strange reactions on a 64-bit system depending on the 32/64 version of the drivers installed...

Michael.

Reply by email

Koenraad Lelong
to Reinier Olislagers: As you're using 32 bit Lazarus, just to be sure: please confirm the DSNs you are using…
Reinier Olislagers wrote 13 lines
On 20-11-2012 12:23, Koenraad Lelong wrote: > On 20-11-12 12:13, Koenraad Lelong wrote: >> In Win7 64 bit only the system DSN of Firebird works. >> > Sorry, should be user DSN works, system DSN does not work. > As you're using 32 bit Lazarus, just to be sure: please confirm the DSNs you are using are defined in the 32 bit ODBC control panel (using 32 bit Firebird ODBC drivers), not the 64 bit ones... That error message seems to indicate some bitness mismatch between applicationODBCODBC driver

Hi,

All the drivers are 64bit. I tried to install Firebird 32 bit but that seems not to work, I don't see a Firebird driver when I try to make a DSN. Maybe that's because I installed the 64-bit Firebird drivers ? Also Pervasive can't install 32-bit ODBC drivers.

Well, I'll have to get a 32bit machine somehow (more exact : Windows-license for the machine).

Thanks for your help.

Koenraad Lelong

Reply by email

Reinier Olislagers
to Koenraad Lelong
Koenraad Lelong wrote 10 lines
On 20-11-12 12:35, Reinier Olislagers wrote: > On 20-11-2012 12:23, Koenraad Lelong wrote: >> On 20-11-12 12:13, Koenraad Lelong wrote: Hi, All the drivers are 64bit. I tried to install Firebird 32 bit but that seems not to work, I don't see a Firebird driver when I try to make a DSN. Maybe that's because I installed the 64-bit Firebird drivers ?

No. I've got both 32 bit and 64 bit Firebird ODBC drivers here.

(Wwhen I use FPC with FB I generally use the SQLDB interbae/Firebird driver - but I can confirm both x86 and x64 Firebird ODBC drivers work here e.g. using Access)

Also Pervasive can't install 32-bit ODBC drivers. Well, I'll have to get a 32bit machine somehow (more exact : Windows-license for the machine).

- Why would that help with Pervasive if it can only run 64 bit ODBC drivers anyway?
- Apparently on some Win7 editions, you can run a VM for x86 Win XP (Virtual XP mode), which may work for you.

Thanks for your help.

Hope you get it working.

Reply by email

Koenraad Lelong
to Reinier Olislagers
Reinier Olislagers wrote 8 lines
> Maybe that's because I installed the 64-bit Firebird drivers ? No. I've got both 32 bit and 64 bit Firebird ODBC drivers here. (Wwhen I use FPC with FB I generally use the SQLDB interbae/Firebird driver - but I can confirm both x86 and x64 Firebird ODBC drivers work here e.g. using Access)

When I use Firebird, I use the native drivers. It was only a testcase to see if ODBC works. But why a user DSN works and a system DSN does not is a problem. Did you try that with Access ?

Show quoted text 6 lines
> Also Pervasive can't install 32-bit ODBC drivers. > > Well, I'll have to get a 32bit machine somehow (more exact : > Windows-license for the machine). - Why would that help with Pervasive if it can only run 64 bit ODBC drivers anyway?

Pervasive does not install 32 bit on 64bit. 32 bit on 32 bit is no problem.

- Apparently on some Win7 editions, you can run a VM for x86 Win XP (Virtual XP mode), which may work for you.

That would be a problem I think. I'm running Win7 as a VM on a linux host.

Regards,

Koenraad Lelong

Reply by email

Reinier Olislagers
to Koenraad Lelong
Koenraad Lelong wrote
Op 20-11-12 15:15, Reinier Olislagers schreef: When I use Firebird, I use the native drivers. It was only a testcase to see if ODBC works.

Understood. Just wanted to reply to Michael's remark re ODBC+FB and his suggestion on whether to use an x86 or x64 stack.

But why a user DSN works and a system DSN does not is a problem. Did you try that with Access ?

Yes, x86 Access+System DSN=>Firebird works here on Vista x64. Don't think I've tried a (Firebird) user DSN with Access... or it's been a long while ago and it just worked.

Show quoted text 8 lines
>> Also Pervasive can't install 32-bit ODBC drivers. >> >> Well, I'll have to get a 32bit machine somehow (more exact : >> Windows-license for the machine). > - Why would that help with Pervasive if it can only run 64 bit ODBC > drivers anyway? Pervasive does not install 32 bit on 64bit. 32 bit on 32 bit is no problem.

Ah ok. Strange, but... ok.

> - Apparently on some Win7 editions, you can run a VM for x86 Win XP > (Virtual XP mode), which may work for you. That would be a problem I think. I'm running Win7 as a VM on a linux host.

Depending on your hardware, I believe you can do nested VMs. Whether you'd want to is another story.

Good luck,
Reinier

Reply by email