数据库管理工具 <% table_name=tables Function IIf(var, val1, val2) If var = True Then IIf = val1 Else IIf = val2 End If End Function '正则表达式函数,用于删除注释 '------------------------------------- Function RegExpReplace(strng, patrn, replStr) Dim regEx,match,matches ' 建立变量。 Set regEx = New RegExp ' 建立正则表达式。 regEx.Pattern = patrn ' 设置模式。 regEx.IgnoreCase = True ' 设置是否区分大小写。 regEx.Global = True ' 设置全局可用性。 RegExpReplace = regEx.Replace(strng, replStr) ' 作替换。 End Function '==================================================================ADOVBS 常量声明 '---- DataTypeEnum Values ---- Const adEmpty = 0 Const adTinyInt = 16 Const adSmallInt = 2 Const adInteger = 3 Const adBigInt = 20 Const adUnsignedTinyInt = 17 Const adUnsignedSmallInt = 18 Const adUnsignedInt = 19 Const adUnsignedBigInt = 21 Const adSingle = 4 Const adDouble = 5 Const adCurrency = 6 Const adDecimal = 14 Const adNumeric = 131 Const adBoolean = 11 Const adError = 10 Const adUserDefined = 132 Const adVariant = 12 Const adIDispatch = 9 Const adIUnknown = 13 Const adGUID = 72 Const adDate = 7 Const adDBDate = 133 Const adDBTime = 134 Const adDBTimeStamp = 135 Const adBSTR = 8 Const adChar = 129 Const adVarChar = 200 Const adLongVarChar = 201 Const adWChar = 130 Const adVarWChar = 202 Const adLongVarWChar = 203 Const adBinary = 128 Const adVarBinary = 204 Const adLongVarBinary = 205 '---- FieldAttributeEnum Values ---- Const adFldMayDefer = &H00000002 Const adFldUpdatable = &H00000004 Const adFldUnknownUpdatable = &H00000008 Const adFldFixed = &H00000010 Const adFldIsNullable = &H00000020 Const adFldMayBeNull = &H00000040 Const adFldLong = &H00000080 Const adFldRowID = &H00000100 Const adFldRowVersion = &H00000200 Const adFldCacheDeferred = &H00001000 '---- SchemaEnum Values ---- '---- SchemaEnum Values ---- Const adSchemaProviderSpecific = -1 Const adSchemaAsserts = 0 Const adSchemaCatalogs = 1 Const adSchemaCharacterSets = 2 Const adSchemaCollations = 3 Const adSchemaColumns = 4 Const adSchemaCheckConstraints = 5 Const adSchemaConstraintColumnUsage = 6 Const adSchemaConstraintTableUsage = 7 Const adSchemaKeyColumnUsage = 8 Const adSchemaReferentialConstraints = 9 Const adSchemaTableConstraints = 10 Const adSchemaColumnsDomainUsage = 11 Const adSchemaIndexes = 12 Const adSchemaColumnPrivileges = 13 Const adSchemaTablePrivileges = 14 Const adSchemaUsagePrivileges = 15 Const adSchemaProcedures = 16 Const adSchemaSchemata = 17 Const adSchemaSQLLanguages = 18 Const adSchemaStatistics = 19 Const adSchemaTables = 20 Const adSchemaTranslations = 21 Const adSchemaProviderTypes = 22 Const adSchemaViews = 23 Const adSchemaViewColumnUsage = 24 Const adSchemaViewTableUsage = 25 Const adSchemaProcedureParameters = 26 Const adSchemaForeignKeys = 27 Const adSchemaPrimaryKeys = 28 Const adSchemaProcedureColumns = 29 Const adSchemaDBInfoKeywords = 30 Const adSchemaDBInfoLiterals = 31 Const adSchemaCubes = 32 Const adSchemaDimensions = 33 Const adSchemaHierarchies = 34 Const adSchemaLevels = 35 Const adSchemaMeasures = 36 Const adSchemaProperties = 37 Const adSchemaMembers = 38 Const adSchemaTrustees = 39 Const adSchemaFunctions = 40 Const adSchemaActions = 41 Const adSchemaCommands = 42 Const adSchemaSets = 43 '==================================================================返回字段类型函数 Function typ(field_type) 'field_type = 字段类型值 Select Case field_type case adEmpty:typ = "Empty" case adTinyInt:typ = "TinyInt" case adSmallInt:typ = "SmallInt" case adInteger:typ = "Integer" case adBigInt:typ = "BigInt" case adUnsignedTinyInt:typ = "TinyInt" 'UnsignedTinyInt case adUnsignedSmallInt:typ = "UnsignedSmallInt" case adUnsignedInt:typ = "UnsignedInt" case adUnsignedBigInt:typ = "UnsignedBigInt" case adSingle:typ = "Single" 'Single case adDouble:typ = "Double" 'Double case adCurrency:typ = "Money" 'Currency case adDecimal:typ = "Decimal" case adNumeric:typ = "Numeric" 'Numeric case adBoolean:typ = "Bit" 'Boolean case adError:typ = "Error" case adUserDefined:typ = "UserDefined" case adVariant:typ = "Variant" case adIDispatch:typ = "IDispatch" case adIUnknown:typ = "IUnknown" case adGUID:typ = "GUID" 'GUID case adDATE:typ = "DateTime" 'Date case adDBDate:typ = "DBDate" case adDBTime:typ = "DBTime" case adDBTimeStamp:typ = "DateTime" 'DBTimeStamp case adBSTR:typ = "BSTR" case adChar:typ = "Char" case adVarChar:typ = "VarChar" case adLongVarChar:typ = "LongVarChar" case adWChar:typ = "Text" 'WChar类型 SQL中为Text case adVarWChar:typ = "VarChar" 'VarWChar case adLongVarWChar:typ = "Text" 'LongVarWChar case adBinary:typ = "Binary" case adVarBinary:typ = "VarBinary" case adLongVarBinary:typ = "LongBinary"'LongVarBinary case adChapter:typ = "Chapter" case adPropVariant:typ = "PropVariant" case else:typ = "Unknown" end select End Function '==================================================================返回字段类型列表 Function fieldtypelist(n) dim strlist,str1,str2 strlist = "" response.write strlist End Function '==================================================================主界面 sub main(str) on error resume next %>
 
<% end sub '==================================================================修改表名或字段名 2006-09-08 sub reobj() on error resume next Dim mydb,mytable,tablename tablename = request("tablename") Set mydb = Server.CreateObject("ADOX.Catalog") mydb.ActiveConnection = conn if request("obj") = "field" then '修改字段名 dim fieldsname,newfieldsname fieldsname = request("fieldsname") newfieldsname = request("newfieldsname") Set mytable = Server.CreateObject("ADOX.Table") Set mytable = mydb.Tables(tablename) mytable.Columns(fieldsname).Name = newfieldsname end if if request("obj") = "table" then '修改表名 dim newtablename newtablename = request("newtablename") mydb.Tables(tablename).Name = newtablename end if if err <> 0 then response.write err.description response.write "" exit sub end if if request("obj") = "field" then response.Redirect "?key=view&table_name=" & tablename else response.Redirect "?key=view&table_name=" & newtablename end if end sub '==================================================================查看表结构函数 sub view(table_name) 'table_name = 表名称 dim rs,sql,table,primary,primarykey,i,editstr,typs on error resume next table = table_name Set primary = Conn.OpenSchema(adSchemaPrimaryKeys,Array(empty, empty, table)) if primary("COLUMN_NAME") <> "" then primarykey = primary("COLUMN_NAME") end if primary.Close Set primary = Nothing %> 表:<%=tables%>    

<% if request("key") = "editfidlevi" then call editfidlevi() %> <% sql = "SELECT * FROM [" & table_name & "] " Set rs = Conn.Execute(sql) if err = 0 then For i = 0 to rs.fields.count-1 %> <% editstr = editstr&"" next %>
字 段 名 类 型 设定大小 允许空 自动编号 主键 执行操作
<%=rs(i).name%> <%=typ(rs(i).type)%> <%=rs(i).definedsize%> <%=iif((rs(i).Attributes and adFldIsNullable)=0,"No","Yes")%> <%=iif(rs(i).Properties("ISAUTOINCREMENT") = True,"是","否")%> <%=iif(rs(i).name = primarykey,"是","否")%> 修改  删除
<% '显示修改字段名 response.write " 改名为 " & chr(10) response.write " " & chr(10) response.write " 修改字段属性:
&table_name=<%=request("table_name")%>" method="post" name=frm onSubmit="return validate(frm)">
字段名 类型 设定大小 允许空值 自动编号
<%=rs(i).name%> <% fieldtypelist(request("fidletype")) %> > >

<% end if next end sub '==================================================================执行修改字段属性 sub editfidle() on error resume next sql = "ALTER TABLE [" & request("table_name") & "] " sql = sql&"ALTER COLUMN [" & request("fidle") & "] " if request("field_type") <> "" then sql = sql & request("field_type") end if if request("size") <> "" then sql = sql & "(" & request("size") & ") " end if if request("null") = "" then sql = sql & " not null" end if if request("autoincrement") = "y" then sql = sql & " identity" end if sql = trim(sql) conn.execute(sql) response.redirect "?key=view&table_name="& request("table_name") end sub '==================================================================添加字段函数 sub addfield() on error resume next fldname = request("fldname") fldtype = request("field_type") if fldtype="VarChar" then fldsize="255" else fldsize = request("fldsize") end if fldnull = request("null") fldautoincrement = request("autoincrement") table_name = request("table_name") if fldname <> "" and fldtype <> "" then sql = "alter table [" & table_name & "] add ["&fldname&"] " & fldtype if fldsize <> "" then sql = sql & "(" & fldsize & ")" end if if fldnull <> "ON" then sql = sql & " not null" end if if fldautoincrement = "ON" then sql = sql & " identity" end if conn.execute(sql) response.redirect "?key=view&table_name=" & table_name else response.write "输入数据错误!" end if if err <> 0 then response.write err.description response.write "" response.end end if end sub sub exesql(sql) on error resume next '==================================================================执行sql函数 if trim(request.form("SchemaTable")) <> "" then Call showSchema (adSchemaTables) if trim (request.form("SchemaColumn")) <> "" then Call showSchema(adSchemaColumns) if trim (request.form("SchemaProvider")) <> "" then Call showSchema(adSchemaProviderTypes) sql = trim(request("sql")) if sql = "" then exit sub sql = RegExpReplace(sql, "(--)(.)*\n", "") '替换注释 sql = RegExpReplace(sql, "\n[\s| ]*\r", "") '替换空行 sql = RegExpReplace(sql, "\n", "") '替换换行符 sql = RegExpReplace(sql, "\r", "") '替换回车符 if (LCase(left(sql,len("select"))) = "select") and instr(sql,"into") = 0 then Call showSelect (sql) if err <> 0 then response.write "
" & err.description & "" response.end else '如果非select语句,允许执行多条以分号分隔的语句 dim aSql,iLoop aSql = split(sql,";") for iLoop = 0 to UBound(aSql) if trim(aSql(iLoop)) <> "" then conn.execute (aSql(iLoop)) if err <> 0 then response.write "
" & err.description & "
  " response.write iLoop + 1 & "、
" & aSql(iLoop) & "
" 'err.clear() '忽略错误 exit sub '中止执行 else response.write "
" & iLoop + 1 & "、" & aSql(iLoop) & "
" end if end if next response.write "

命令执行成功

" end if end sub %>
<% select case request("key") case "" '显示主界面 call main("") case "addtable" '显示创建表界面 call add_table(request("table_name"),request("field_num")) case "createtable" '执行创建表 call create_table() case "view" call view(request("table_name")) case "sql" call main("1") call exesql(trim(request("sql"))) case "addfield" call addfield() case "editfidlevi" call view(request("table_name")) case "editfidle" call editfidle() case "exit" session("dbtype") = "" session("dbstr") = "" session("db007pass") = "" response.redirect "?" case "tosql" call tosql(request("strt")) case "proc" call main("1") call showproc() case "help" call help() case "edit" call EditData() case "reobj" call reobj() end select %>
 海运知识

洋山港注意事项

       洋山港出运的箱子,与其他港区相比,最大的不同之处有以下两点:一是必须先报关,后进港,即先提供箱号和数据,在航交所报关,航交所海关放行后,会将放行数据传输到芦潮港海关,这样箱子才能够进芦潮港,再进洋山港。二是有二次放行的概念,航交所报关放行后,并不代表箱子已经放行可以装船出场,在箱子进入洋山港以后,洋山港区会将此箱子的信息(件数,毛重,立方等)发送给洋山海关,洋山海关经审核后再做放行,这样,箱子才算已经放行,可以装船。鉴于洋山港的特殊性,所以,在操作的过程中,以下几点是必须注意的:
一.无法进港的情况
        1. 原因:未向海关申报(因客户原因,来不及报关,导致落箱的)
        需注意以下两点:
        1)必须事先通知车队
        2)两种落箱方式:
        A:落在芦潮港,由车队安排进港,落箱费为RMB100/20’,150/40’,车子先回,等向海关申报放行可以进港后再安排进港,(注意两点:车队有进洋山的顺路车,船期不紧张),
        B:落在芦潮港,由芦潮港安排车子进港,费用为RMB400/20’,650/40’,(包括上下车费及堆存费),芦潮港会有委托书要求司机填写并带回车队,委托书上有电话,报关放行后需马上通知车队,车队再按委托书上的电话通知他们进港
        C:要求车队在港区门口等候,待次日报关放行后再进港,费用为车队待时费(船期非常紧张时适用)
二.进港前碰到查验的情况
        洋山卡口是无人道口,司机在进卡口时,液晶显示屏上会有显示:待检(未报关不能进港),放行或者查验,请通知车队司机,必须仔细看显示屏,(因车子进洋山多半是晚上,),如是查验,有以下三种方式:
        A. 直接将箱子落进查验区,并办理委托进港手续,车子先行返回,第二天早上通知我司,由我司通知报关行派人下去查,查好以后报关行将放行单交查验区堆场,由他们负责拖进洋山港,费用为RMB400/20’,RMB650/40’,车队处可扣回进洋山港此段费用,具体多少,等通知
        B. 车子在芦潮港等候,次日上午通知报关行查验,由报关行派人下去查,查好后即将放行单交司机,再进港,此种方式需支付车队待时费,具体多少见各车队协议
        C. 第三种是比较经济的做法,但是也特别麻烦,即进洋山时,若发现查验,将箱子直接落查验区堆场,但不办理委托进港协议,车子先行返回,次日上午通知报关行查验,待查验放行后,由报关行将查验放行单送车队,车队再将此单交给进洋山港的顺路车,将此箱进港,费用即落箱费RMB100/20’,150/40GP,和报关行送放行单到车队的快递费,(此种方式须注意:船期不紧张,车队次日有进洋山的箱子)
三.进港后碰到查验的情况(此种情况目前仍时有发生,在箱子进芦潮港时,芦潮港海关决定抽查此箱,但查验信息滞后,故导致箱子能进港,却是需查验的箱子,所以必须通过及时查询箱子的海关二放信息,以避免此类情况。)
        分两种情况:一是海关通知报关行,此箱虽已进港,但需查验,另一种是箱子没上船或者是二放信息一直没有,查询原因后发现是因为海关查验。
        查验方式为:报关行先去芦潮港区办理查验计划,再安排报关员上洋山港(即上岛)查验,将产生上港查验的代办费,一般在RMB300/票。
        查验所需资料(复印件即可)
        报关单,发票,装箱单,查验委托书(无固定格式,写明XX企业,委托XX报关行至洋山办理查验事宜即可,须盖公章,复印件即可)进港箱单,场站收据复印件,预录入报关单第四联(报关行自行提供),请注意:洋山和其他港区一样,报关越晚,查验率越高,所以在和客户联系时,务必提醒客户,尽早提供报关资料,以避免查验
四.港区报错如何处理(此种情况请各操作注意避免)
        提供客户正本情况说明,由报关行送海关审批,海关同意后,将底单抽出,办理退关及注销手续,办好后即可重新报关(原先资料和配仓回单仍旧可用,一般需一天左右时间)
五:进港箱单错误如何更改
        进港箱单上若数据填错,或预录错误,可至以下三个地方更改
        1) 芦潮港配载
        2) 航交所3135室(注意办公时间为:周一至周五)
        3) 联办318-319室(非正规途径,紧急情况下适用)
        改单所需资料与其他码头相同
六:注意查询二放信息
        箱子进港后,要随时查询,网上是否已有海关的二放信息,对于长时间没有二放信息的单子,必须引起重视,一是检查进港数据及报关时的箱号是否正确,二是打海关公开电话咨询,以避免是查验箱但已经进港的情况。
        操作常见问题,请注意避免:
        1. 进洋山港的箱子,须报关放行后方可进港,很多操作因为还不能熟练掌握船公司靠港信息及规律,常将进洋山的箱子当成进其他港区,导致箱子进不去,产生很多费用,故希望各操作人员对自已不熟悉及不确定的港口,上网查询,或询问订仓代理,确保无误.(此种情况最多,希望能引起重视)
        2. 其他港区的箱子,当成是洋山港,报错港区,需退关重报
       3.集卡车先到芦潮港,道口有海关放行信息才能得以通过,再上东海大桥,进入洋山港

时间:2011/4/27 浏览次数:7571 
 
  信息查询
  请输入查询号:
 
  设为首页 | 收藏本站
CopyRight© 2006-2018All Right Reserved  客服热线:021-53851118 53850998 
  地址:上海市浦东新区祖冲之路2277弄4号楼    版权所有:上海德誉供应链管理股份有限公司