示例#1
0
 private ISpecificType GetAccessTypeString(DbTypeString type)
 {
     if (type.IsBinary)
     {
         AccessTypeBinary res = new AccessTypeBinary();
         res.Length = type.Length;
         return(res);
     }
     else
     {
         AccessTypeCharacter res = new AccessTypeCharacter();
         res.Length = type.Length;
         return(res);
     }
 }
示例#2
0
        private AccessTypeBase MakeSpecificAccessType(string dt, int len, int prec, int scale)
        {
            switch (dt.ToLower())
            {
            case "short":
                return(new AccessTypeSmallInt());

            case "long":
                return(new AccessTypeInteger());

            case "single":
                return(new AccessTypeReal());

            case "double":
                return(new AccessTypeFloat());

            case "currency":
                return(new AccessTypeMoney());

            case "datetime":
                return(new AccessTypeDatetime());

            case "bit":
                return(new AccessTypeBit());

            case "byte":
                return(new AccessTypeTinyInt());

            case "guid":
                return(new AccessTypeUniqueIdentifier());

            case "longbinary":
            case "bigbinary":
                return(new AccessTypeImage());

            case "varbinary":
                return(new AccessTypeBinary());

            case "longtext":
                return(new AccessTypeText());

            case "varchar":
            {
                if (len == 0)
                {
                    return(new AccessTypeText());
                }
                AccessTypeCharacter res = new AccessTypeCharacter();
                res.Length = len;
                return(res);
            }

            case "decimal":
            {
                AccessTypeDecimal res = new AccessTypeDecimal();
                res.Precision = prec;
                res.Scale     = scale;
                return(res);
            }
            }
            ReportUnknownType(dt);
            return(new AccessTypeGeneric {
                Sql = dt
            });
            //throw new DbAnalyseError(String.Format("Unknown MS Access type:{0}", dt));
        }