I forgot to state my config.

I'm running Django in my dev box, on Windows 2000 Pro. The server is
running Windows 2003 Server, located elsewhere, accessed transparently
via a secure VPN thru standard port 1433.

Plus, I've been trying two more things:

1. Create an empty database, create some models, and try to do a
syncdb. Here's what I got:

D:\dev\eclipse\eclipse_workspace\ceneje>manage.py syncdb
Traceback (most recent call last):
  File "D:\dev\eclipse\eclipse_workspace\ceneje\manage.py", line 11, in ?
    execute_manager(settings)
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\core\mana
gement.py", line 1315, in execute_manager
    execute_from_command_line(action_mapping, argv)
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\core\mana
gement.py", line 1239, in execute_from_command_line
    action_mapping[action]()
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\core\mana
gement.py", line 449, in syncdb
    table_list = _get_table_list()
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\core\mana
gement.py", line 68, in _get_table_list
    return get_introspection_module().get_table_list(cursor)
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\backen
ds\ado_mssql\introspection.py", line 2, in get_table_list
    raise NotImplementedError
NotImplementedError

2. Manually create 'matching' models effectively copying a live,
legacy DB, running the shell, and trying to access a table via
Django's ORM. Here's what I got (Filter is one of my models, mapping
correctly to a Filters table on my db).

D:\dev\eclipse\eclipse_workspace\ceneje>manage.py shell
Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from ceneje.products.models import Filter
>>> f = Filter.objects.get(pk=19)
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\models
\manager.py", line 70, in get
    return self.get_query_set().get(*args, **kwargs)
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\models
\query.py", line 211, in get
    obj_list = list(clone)
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\models
\query.py", line 103, in __iter__
    return iter(self._get_data())
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\models
\query.py", line 430, in _get_data
    self._result_cache = list(self.iterator())
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\models
\query.py", line 172, in iterator
    cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "") + ",".join
(select) + sql, params)
  File "D:\dev\Python23\lib\site-packages\django-0.95-py2.3.egg\django\db\backen
ds\util.py", line 12, in execute
    return self.cursor.execute(sql, params)
  File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 592, in ex
ecute
    self.executeHelper(operation,0,parameters)
  File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 552, in ex
ecuteHelper
    self._raiseCursorError(DatabaseError,tracebackhistory)
  File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 407, in _r
aiseCursorError
    eh(self.conn,self,errorclass,errorvalue)
  File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 38, in sta
ndardErrorHandler
    raise errorclass(errorvalue)
DatabaseError:
-----------
Strategy 1: Traceback:Traceback (most recent call last):
   File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 539, in e
xecuteHelper
    raise DatabaseError(e)
 DatabaseError: (-2147352567, 'Exception occurred.', (0, 'ADODB.Parameters', 'It
em cannot be found in the collection corresponding to the requested name or ordi
nal.', 'C:\\WINNT\\HELP\\ADO270.CHM', 1240649, -2146825023), None)


-----------
Strategy 2: Traceback:Traceback (most recent call last):
   File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 540, in e
xecuteHelper
    adoRetVal=self.cmd.Execute()
   File "<COMObject ADODB.Command>", line 3, in Execute
   File "D:\dev\Python23\lib\site-packages\win32com\client\dynamic.py", line 258
, in _ApplyTypes_
    result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes
) + args)
 com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB Provider
for SQL Server', "Line 1: Incorrect syntax near 's'.", None, 0, -2147217900), No
ne)


-----------
Strategy 3: Traceback:Traceback (most recent call last):
   File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 539, in e
xecuteHelper
    raise DatabaseError(e)
 DatabaseError: (-2147352567, 'Exception occurred.', (0, 'ADODB.Parameters', 'It
em cannot be found in the collection corresponding to the requested name or ordi
nal.', 'C:\\WINNT\\HELP\\ADO270.CHM', 1240649, -2146825023), None)


-----------
Strategy 4: Traceback:Traceback (most recent call last):
   File "D:\dev\Python23\lib\site-packages\adodbapi\adodbapi.py", line 540, in e
xecuteHelper
    adoRetVal=self.cmd.Execute()
   File "<COMObject ADODB.Command>", line 3, in Execute
   File "D:\dev\Python23\lib\site-packages\win32com\client\dynamic.py", line 258
, in _ApplyTypes_
    result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes
) + args)
 com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB Provider
for SQL Server', "Line 1: Incorrect syntax near 's'.", None, 0, -2147217900), No
ne)

--- ADODBAPI on command:SELECT [Filters].[idFilters],[Filters].[idKategorije],[F
ilters].[filterName],[Filters].[filterType],[Filters].[filterDesc] FROM [Filters
] WHERE ([Filters].[idFilters] = %s) with parameters: [19]
>>>

Checking it with SQL Profiler, I see where the error lies:

SELECT 
[Filters].[idFilters],[Filters].[idKategorije],[Filters].[filterName],[Filters].[filterType],[Filters].[filterDesc]
FROM [Filters] WHERE ([Filters].[idFilters] = %s)

In this query, %s is not being interpolated to my requested value ("19").

Sorry for the long, ugly pastes. Hope this helps you helping us :-)

Regards,

Carlos



> OK, here I go.
>
> I'm running the following, from my project's dir. Note: the SQL server
> is not local, I connect to it via a VPN, and testing it, it works OK,
> but who knows.
>
> D:\dev\eclipse\eclipse_workspace\ceneje>manage.py inspectdb
> # This is an auto-generated Django model module.
> # You'll have to do the following manually to clean this up:
> #     * Rearrange models' order
> #     * Make sure each model has one field with primary_key=True
> # Feel free to rename the models, but don't rename db_table values or field 
> name
> s.
> #
> # Also note: You'll have to insert the output of 'django-admin.py 
> sqlinitialdata
>  [appname]'
> # into your database.
>
> from django.db import models
>
> Error: 'inspectdb' isn't supported for the currently selected database 
> backend.
>
>
> My settings.py
>
> DATABASE_ENGINE = 'ado_mssql'
> DATABASE_NAME = 'obspm_testing'
> DATABASE_USER = '*****'
> DATABASE_PASSWORD = '***'
> DATABASE_HOST = '192.169.5.8'
> DATABASE_PORT = '1433'
>
> Hope this sheds some light!
>
> Best regards and thank you.
>
> On 10/26/06, Carlos Yoder <[EMAIL PROTECTED]> wrote:
> > As soon as I get to the office I'll let you know... thanks for replying!
> >
> > > Hmm.  What's the exact error you are getting?  I'm running the code on
> > > 3 different boxes (2 Win XP Pro and 1 Windows Server 2003) against
> > > MSDE and SQL Server 2000 without issues.  What system and server are
> > > you using?
> > >
> > > You should be able to use either manage.py in the project directory or
> > > django-admin.py in the directory below the project directory.
> > > Remember to run django-admin.py with the --settings option so it knows
> > > where to look for your settings file.
> > >
> > > Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to