Archiwum December 2007

Dec 14 2007

Access database (mdb file), format() function and ODBC/PHP

Napisał(a) Grzegorz w kategorii English, Informatyka, Krótkie, Porady

Can You tell a difference between

SELECT *, format(Data_ur, "yyyy-mm-dd") AS Datur FROM Czlonkowie

and

SELECT *, format(Data_ur, 'yyyy-mm-dd') AS Datur FROM Czlonkowie

?

It turns out that when using ODBC to connect to Microsoft Access database (in an mdb file), one has to use single quotes when writing function parameters. The first statement runs fine from the Access itself, but when called through the ODBC (for instance when using PHP and PDO) it returns empty set (it doesn’t even throw an exception).

The second statement (with single quotes) runs fine through ODBC. Worth remembering.

Brak komentarzy

Dec 03 2007

59%

Napisał(a) Grzegorz w kategorii Humor, Informatyka, Krótkie

O cholera :)

Brak komentarzy