Il problema credo che risieda nell' EOF .
Con MySQL funziona?