是否有限制字符ADO VARCHAR处理? [英] Are there restricted characters in ADO varchars?
问题描述
我们对我们的内联网,使用ASP / VBScript中建立了一个简单的文件浏览器。该文件是由脚本读取并添加到ADO记录集(未连接到数据库),因此我们可以很容易的内容进行排序:
We have a simple file browser on our intranet, built using ASP/vbscript. The files are read by the script and added to an ADO Recordset (not connected to a database), so we can sort the contents easily:
Set oFolderContents = oFolder.Files
Set rsf = Server.CreateObject("ADODB.Recordset")
rsf.Fields.Append "name", adVarChar, 255
rsf.Fields.Append "size", adInteger
rsf.Fields.Append "date", adDate
rsf.Fields.Append "type", adVarChar, 255
rsf.Open
For Each oFile In oFolderContents
if not left(oFile.Name, 3) = "Dfs" then 'Filter DFS folders
rsf.AddNew
rsf.Fields("name").Value = oFile.Name
rsf.Fields("size").Value = oFile.Size
rsf.Fields("date").Value = oFile.DateCreated
rsf.Fields("type").Value = oFile.Type
end if
Next
在一个特定的文件夹,我们正在一个错误:
In one particular folder we are getting an error:
Microsoft Cursor Engine error '80040e21'
Multiple-step operation generated errors. Check each status value.
这点到线
rsf.Fields("name").Value = oFile.Name
在code以上。
我最初认为这是一个长文件名引起的,但我检查目录中的所有文件的长度 - 尽管有些是相当长的,一切皆在上面设置的255个字符限制(最大为198个字符)
My initial thought this was caused by a long file name, but I checked the length of all the files in the directory - although some are quite long, all are under the 255 character limit set above (largest is 198 characters long).
有问题的文件夹中有近2000 PDF文件,我没有权限修改的内容,只是读(这是一个技术库)。这些文件有ID# - 文章的命名约定。有些特殊字符,如,与放大器,和(或) - 可能其中的一些会造成问题的?我不记得以前有这样的问题。我试图寻找谷歌在ADO特殊字符,但无法找到任何这似乎相关的。
The folder in question has nearly 2000 PDFs in it, and I do not have permissions to alter the contents, just read (it's a technical library). The files have a naming convention of "ID# - Paper Title". Some have special characters such as ', &, and ( or ) - could some of these be causing the issue? I don't recall having such a problem before. I tried searching Google for special characters in ADO, but couldn't find anything which seemed relevant.
感谢: - )
推荐答案
您是否尝试过使用adVarWChar的名称列?
Have you tried using adVarWChar for the name column?
这篇关于是否有限制字符ADO VARCHAR处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!