SqlServer Codegeneration Unsupported Field Type: sysname

thread: 7 messages  |  last: a year ago  |  started: wednesday, may 26, 2010, 10:06 am pdt


#1  |  Neel Basu (Kolkata, WB) India
Wednesday, May 26, 2010, 10:06 AM PDT

HI! All
I am quite new to QCodo and SqlServer too.
QCodo Code Generation works fine for MySQL
It also works with General SqlServer Tables
(However I got errors with Tables that doesn't have a PK)
But I've faced the Following Error from the Code generator While Connecting to a Database that is being used for an ASP.net Website.

error: MS SQL Server Error: Unsupported Field Type: sysname

actually I am coding a segment of a asp.net website in PHP.
I dont know much about SqlServer. But Still I noticed some auto generated (?? I am not Sure) Tables in the database starting with asp
The asp Guy told me that is for ASP's Membership Controll. and These tables are handled automatically by the syetem itself.

abviously I dont need those tables in my part of application. but QCode's Code generator is trying to access them too (?? am I wrong)

So Whats the Solution ??

i) How can I mention which tables to read and which one not
ii) Is there minor Changes or tricks can make QCodo Codo generator grab those system tables too

Any Helps Appreciated.

Regards, Neel

#2  |  Gaspar Attila (Odorheiu Secuiesc, RO) Romania
Wednesday, May 26, 2010, 12:59 PM PDT

Hi Basu!

For more information about Qcodos PK requirement:
http://examples.qcodo.com/examples/code_generator/primary_keys.php

In codegen.xml file you may specify which tables include or exclude from codegeneration.

You must read this forum topic, maybe help:
http://www.qcodo.com/forums/forum.php/0/2273/?search=codegen

P.S. Sorry for my bad english.


Regards,
Attila

#3  |  Neel Basu (Kolkata, WB) India
Wednesday, May 26, 2010, 11:16 PM PDT

==== FIXED ====
Just Changing One linen would solve the Issue

File: QSqlServerDatabase.class.php
Line: 684
Todo: add another Line and put
case 'sysname':

Thats all

However I'vent tested is yet.
But I am quite confident that this trick would work.

#4  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Wednesday, May 26, 2010, 11:30 PM PDT

So are you wanting codegen to treat sysname like a varchar?

Let us know how it works out -- if you see that it looks good, we'll commit the fix to the core.

#5  |  Neel Basu (Kolkata, WB) India
Wednesday, May 26, 2010, 11:54 PM PDT

Exactly
Though I am NOT a SqlServer User
and I DONT LIKE SqlServer at all.

a google searched revealed the probability of sysname as an alias of nvarchar(256) or nvarchar(128) not sure.
This is microsoft world and anything can happen.

So I asked the asp Guy to change sysname Columns of already working membership Controll Tables (Probabbly generated and handled by asp platform itself) to varchar.
However the process was too tricky cause in the design view it was was showing nvarchar as the column type where as QCodo was getting sysname as its column type.
and after completion of Column type conversion all ASPapplications went well.

However I'vent tested the QCodo with bug fix yet. I'll do that on evening.

Cheers.

#6  |  Neel Basu (Kolkata, WB) India
Thursday, May 27, 2010, 5:16 AM PDT

Yep Its working after that Fix.

You can make new release now

#7  |  Mike Ho (Sunnyvale, CA) United States of America Qcodo Administrator
Tuesday, June 1, 2010, 9:04 AM PDT

Cool... thanks!  I've committed the change into github, and should be in the 0.4.16 release.



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.