SQL Server的一个错误信息, 谁帮我...

zdg 2000-01-21 01:44:00
我在本地远程调用SQL Server数据库没有错, 但是传到网络上后报一下错误:

Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'

发生错误

/csdn/news/addnews.asp, 行73

第73行就是一个简单的语句:
65: set rs=Conn.Execute("select news_id, news_title, news_subject, news_image, news_desc, news_comment, news_to, news_url, news_time, news_delete, news_key1, news_key2, news_key3, news_key4 from csdn_news where news_id="&m_change)
66: m_to=false
67: m_delete=false
68:
69: if not rs.EOF then
70: m_desc = rs("news_desc")
71: m_comment=rs("news_comment")
72: m_url=rs("news_url")
73: m_tto=rs("news_to")
74: m_tdelete=rs("news_delete")

我在服务器配置ODBC数据源为本地数据库...

请问各位大虾是否碰到过这种情况, 怎么解决???
...全文
335 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
solomon 2000-01-26
  • 打赏
  • 举报
回复
TO zdg:
It too late. I just want to say you should change line 72 and 73's position, and you found it.
But an other way you can try.

set rs = createobject('adodb.recordset')
rs.open "select ....", conn, 3, 3

Then switch the line 72 and 73, to see the result.

if it works, you might always use open method rather than execute.
PS: the parameter 3, 3 is somewhat important,
because My chinese windows 95 is down, I had to stay in jp mode for a few
days.
rmh 2000-01-26
  • 打赏
  • 举报
回复
如果你要在网络上调用数据库必须使用文件数据源!!!
1、User DSN 能被当前用户使用
2、System DSN能被本机所有用户使用
3、File DSN能在本机或远程访问
zdg 2000-01-25
  • 打赏
  • 举报
回复
问题我已经基本上查出来了, 将72行和73行换个位置就可以了, 我发现了这个规律:
1. 为什么select 出来的结果在使用的时候有顺序性(在本地机器Win98+PWS上没有)???
2. 为什么不能用 "select * from csdn_news where news_id="&m_change???

谁能回答这两个问题, 将大大送分...
DOU 2000-01-25
  • 打赏
  • 举报
回复
根据zdg的反馈,此种情况应为一个ADO本身的BUG,我好象也曾遇到过。当时是用
rs.Fields("FieldName").Value代替省略形式rs("FieldName")来解决的。也许适合你的情况。1,2应该同属一类情况,建议升级ADO并尝试替换省略形式
xhaibo 2000-01-25
  • 打赏
  • 举报
回复
这问题我见过,把数据源换成系统数据源就行了
LiuRong 2000-01-25
  • 打赏
  • 举报
回复
很可能是ADO2.0在将VB类型绑定到SQL类型时的一个BUG(特别是WCHAR -> nvarchar)
升级到ADO2.1可以解决问题
forgettor 2000-01-25
  • 打赏
  • 举报
回复
我查了一下OLEDBErr.h文件,好象微软也没给出此错误的详细信息,
zdg 2000-01-25
  • 打赏
  • 举报
回复
给rmh:
是System DSN呀...
rmh 2000-01-25
  • 打赏
  • 举报
回复
数据源是否是用户数据源,把它换成系统数据源或文件数据源,试试...
zdg 2000-01-22
  • 打赏
  • 举报
回复
给DOU:
我没有用Global.asa, 可能是网络配置的问题, 我再查查...
给cloud:
news_to是int型 = 0, 不应该出错

这个奇怪的现象有点像写Delphi或C++程序时不注意某些变量被覆盖的感觉...
可能是DSN配置的问题.
cloud 2000-01-21
  • 打赏
  • 举报
回复
看是不是字段[m_tto]的值是‘NULL’
DOU 2000-01-21
  • 打赏
  • 举报
回复
Some comments maybe help you :
1. Change Global.asa file,make the connection string refer to accurate server ,database ,uid,pwd.
2. DSN must be a SYSTEM DSN
3. Comfig SQL Server(both Server and client ) ,Using TCP/IP network libary replace namepipe

Hope this can help you,If not ,can you give me more infomation about your configure and the error?
zdg 2000-01-21
  • 打赏
  • 举报
回复
我这里没有错误手册, forgettor能告诉我具体帮助吗???
forgettor 2000-01-21
  • 打赏
  • 举报
回复
错误号为3617,查查3617号错误的帮助

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧