| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 420 人关注过本帖
标题:谁帮我啊
只看楼主 加入收藏
linuuxpluto
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2005-8-6
收藏
 问题点数:0 回复次数:2 
谁帮我啊
'************************************* '此函数用来把<A href="file://server/F/综艺大哥大">综艺大哥大</A> '把这个字符穿格式化为F/综艺大哥大 '************************************* function formatStr(Str) if Str<>"" then Str=left(trim(Str),len(trim(Str))) if left(Str,2)="<a" or left(Str,2)="<A" and right(Str,2)="a>" or right(Str,2)="A>" then StartPos=inStr(Str,"file:")+14 offSetPos=inStr(Str,">")-StartPos-1 getPath=mid(Str,StartPos,offSetPos) getPath=replace(getPath,left(getPath,1),left(getPath,1)&":") 'response.write("该文件的路径是:<font color=red>&quot;"&getPath&"&quot;</font>影片名字是:<font color=red>&quot;"&v_name&"&quot;</font>字符的长度是:"&len(Str)&"<Br>") end if else exit function end if formatStr=getPath end function '******************************************************** '文件的初始化 '******************************************************** set fso=server.CreateObject("scripting.filesystemobject") path="c:\inetpub\wwwroot\" filename="dy.txt" dim StrBuffer set sourceStream=fso.opentextfile(path&filename,1) StrBuffer="" '******************************************************** '数据库的初始化 '******************************************************** set conn=server.CreateObject("adodb.connection") conn.open "dsn=test;uid=sa;" set rs1=server.CreateObject("adodb.recordset") sqlstr="select * from movie" rs1.open sqlstr,conn,1,3 '**************************************************** while not sourceStream.atendofStream StrBuffer=sourceStream.readline() dataS=formatStr(StrBuffer) video_name=split(trim(dataS),"/") 'v_name=video_name(ubound(video_name)) for y=0 to ubound(video_name) '**** v_name=video_name(ubound(video_name)) '****这地方提示下标越界,没办法用个for解决 next '**** questr="insert movie (video_name,path,video_type) values ('"&v_name&"','"&dataS&"',1)" response.write("测试:"&dataS&".影片名:"&v_name&"<br>") questr=cstr(questr) response.Write(questr&"<br>") conn.execute(questr) wend '************************************* 'dy.txt的内容如下 '************************************ <A href="file://server/F/综艺大哥大">综艺大哥大</A> <A href="file://server/E/康熙来了">康熙来了</A> <A href="file://server/G/综艺最爱宪">综艺最爱宪</A> <A href="file://server/E/电影/名人讲座">名人讲座</A> <A href="file://server/F/系列/周星驰系列">周星驰系列</A> <A href="file://server/F/系列/007系列007">007系列</A> <A href="file://server/F/系列/成龙系列">成龙系列</A> <A href="file://server/F/系列/施瓦辛格系列">施瓦辛格系列</A> <A href="file://server/F/综艺">演唱会颁奖典礼</A> <A href="file://server/F/系列/李连杰系列电影">李连杰系列</A> <A href="file://server/H/20050704/哈利波特系列">哈利波特系列</A> <A href="file://server/H/今日说法2005上半年全集">今日说法</A> <A href="file://server/E/中国文化一百讲">中国文化百讲</A> <a href="file://server/I/20050624/头文字D">头文字D</a> <a href="file://server/G/20050701/世界大战">世界大战</a> <a href="file://server/G/20050604/盗宝神偷">盗宝神偷</a> <a href="file://server/G/20050604/极限特工2">极限特工2</a> '************************************* '一切正常的情况下,为什么提示如下的错误 '错误类型: 'Microsoft OLE DB Provider for ODBC Drivers (0x80040E57) '[Microsoft][ODBC SQL Server Driver][SQL Server]将截断字符串或二进制数据。 '/format.asp, 第 89 行 '
2005-08-06 13:15
Stayor
Rank: 1
等 级:新手上路
帖 子:137
专家分:0
注 册:2005-8-4
收藏
得分:0 
questr="insert movie (video_name,path,video_type) values ('"&v_name&"','"&dataS&"',1)" 这句话有问题吧。
2005-08-06 21:04
linuxplutz
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2005-8-7
收藏
得分:0 
嘛问题
2005-08-07 21:15
快速回复:谁帮我啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014556 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved