<%@ LANGUAGE = VBScript CodePage = 936%>
<%
'on error resume next
dim conn,connstr
set conn=server.createobject("adodb.connection")
connstr="Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & Server.MapPath("news.mdb")
conn.open connstr
dim rs
set rs=server.createobject("adodb.recordset")
'###########################
'½ØÈ¡×Ö·û,·½±ãÅÅ°æ
'2005/01
'###########################	
Function CutStr(str,length)
	dim length2,i,y,TmpStr
	str=Trim(""&str)
	if str="" Then CutStr="" :Exit Function
	length2=length*2
	y=0
	TmpStr=""
	if len(str)<length Then CutStr=str :Exit Function
		for i=1 to len(str)
				if asc(mid(str,i)) < 0 or asc(mid(str,i)) >255 then
					y=y+2
				Else
					y=y+1
				End If
					If Y>length2 Then
							CutStr=left(TmpStr,i-1)&"..."
							exit Function
					End If				
				TmpStr=TmpStr & mid(str,i,1)
		next
		CutStr=TmpStr
End Function

Function GetSql(a,b)
	tSql="SELECT t_news.n_id,t_type_son.ts_name,t_type.t_dir&'/'&t_type_son.ts_dir&'/'&t_news.n_fpath&'/'&t_news.n_fname as path, t_news.n_title, t_news.n_date, t_news.n_hit "&_
		   "FROM (t_type_son INNER JOIN t_type ON t_type_son.ts_pid = t_type.t_id) INNER JOIN t_news ON (t_type.t_id = t_news.n_tid) AND (t_type_son.ts_id = t_news.n_tsid)"&_
		   "WHERE t_news.n_tid=CLng("&a&")"
	if b<>"" then TSql=TSql&" AND t_news.n_tsid=CLng("&b&")"
GetSql=Tsql

End Function

%>