I think I spoke too soon. It may be configured correctly.
I have successfully retrieved data from the database using a select
command via command line Python like this:
import kinterbasdb
con = kinterbasdb.connect(
host='localhost', database='employee.fdb',
user='sysdba', password='password'
)
cur = con.cursor()
cur.execute('select * from COUNTRY;')
print cur.fetchall()
I've also successfully created a new table:
cur.execute('create table PERSON1 ( PERSON_ID BIGINT NOT NULL,
FIRST_NAME VARCHAR(35));')
con.commit()
So the question remains why web2py gives me errors...
On Mon, Jun 22, 2009 at 6:37 PM, Alexei
Vinidiktov<[email protected]> wrote:
> I think there's something wrong with my Firebird installation, it must
> be incorrectly built or configured.
>
> Even from the Python command line interpreter I keep getting similar
> errors when executing sql commands...
>
> On Mon, Jun 22, 2009 at 2:58 PM, Alexei
> Vinidiktov<[email protected]> wrote:
>> I've also tried commenting the lines
>>
>> if charset != 'None':
>> self._execute('SET NAMES %s;' % charset)
>>
>> in sql.py but then I got this error message:
>>
>> Traceback (most recent call last):
>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/restricted.py",
>> line 107, in restricted
>> exec ccode in environment\n File
>> "/var/www/alvinru/data/www/bilingsoft.ru/applications/welcome/models/db.py",
>> line 57, in <module>
>> auth.define_tables() # creates all needed tables
>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/tools.py", line
>> 504, in define_tables
>> migrate=self.__get_migrate(self.settings.table_user_name, migrate))
>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/sql.py", line
>> 993, in define_table
>> query = t._create(migrate=migrate)
>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/sql.py", line
>> 1314, in _create
>> self._db._execute(query)\n File
>> "/var/www/alvinru/data/www/bilingsoft.ru/gluon/sql.py", line 864, in
>> <lambda>
>> self._execute = lambda *a, **b: self._cursor.execute(*a, **b)
>> ProgrammingError: (-104, \'isc_dsql_prepare: Dynamic SQL Error SQL
>> error code = -104
>> Token unknown - line 6, column 2 password\')'
>>
>> On Mon, Jun 22, 2009 at 2:08 PM, Alexei
>> Vinidiktov<[email protected]> wrote:
>>> Now I receive an error message that says:
>>>
>>> "'isc_attach_database: I/O error for file "employee.fdb?set_encoding=None"
>>> Error while trying to open file. No such file or directory'"
>>>
>>> On Mon, Jun 22, 2009 at 1:18 PM, mdipierro<[email protected]> wrote:
>>>>
>>>> Use this string instead. It seems some version is Firbird do not like
>>>> setting the default encoding to UTF8.
>>>>
>>>> db = SQLDB('firebird://sysdba:passw...@localhost/employee.fd?
>>>> set_encoding=None')
>>>>
>>>>
>>>> On Jun 21, 9:54 pm, Alexei Vinidiktov <[email protected]>
>>>> wrote:
>>>>> Hello,
>>>>>
>>>>> I'm trying to make a connection to a Firebird db file, but I keep
>>>>> getting this error:
>>>>>
>>>>> Traceback (most recent call last):
>>>>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/restricted.py",
>>>>> line 98, in restricted
>>>>> exec ccode in environment
>>>>> File
>>>>> "/var/www/alvinru/data/www/bilingsoft.ru/applications/notebook/models/db.py",
>>>>> line 12, in <module>
>>>>> db = SQLDB(\'firebird://sysdba:passw...@localhost/employee.fdb\')
>>>>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/sql.py", line
>>>>> 837, in __init__
>>>>> self._execute(\'SET NAMES %s;\' % charset)
>>>>> File "/var/www/alvinru/data/www/bilingsoft.ru/gluon/sql.py", line
>>>>> 835, in <lambda>
>>>>> self._execute = lambda *a, **b: self._cursor.execute(*a,**b)
>>>>> ProgrammingError: (-104, \'isc_dsql_prepare: Dynamic SQL Error SQL
>>>>> error code = -104
>>>>> Token unknown - line 1, column 5 NAMES\')'
>>>>>
>>>>> My connection string in db.py is like this:
>>>>>
>>>>> db = SQLDB('firebird://sysdba:passw...@localhost/employee.fdb')
>>>>>
>>>>> I can successfully connect to the same database from the command line:
>>>>>
>>>>> import kinterbasedb
>>>>> con = kinterbasdb.connect(
>>>>> host='localhost', database='employee.fdb',
>>>>> user='sysdba', password='password'
>>>>> )
>>>>>
>>>>> I'm using CentOS 5.2 with Python 2.5.4, Firebird 2.1.2 Super Server
>>>>> and the latest version of web2py.
>>>>>
>>>>> I'd be grateful for any clues as to what might be happening.
>>>>>
>>>>> --
>>>>> Alexei Vinidiktov
>>>> >>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Alexei Vinidiktov
>>>
>>
>>
>>
>> --
>> Alexei Vinidiktov
>>
>
>
>
> --
> Alexei Vinidiktov
>
--
Alexei Vinidiktov
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---