ACCESS) 3.数据库是MS ACCESS 2000 4.服务器= IIS 5.0 任何想法? Hi all I''m not sure ASP is the problem, but my SQL statement seems fine to me. This works fine :strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON[_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2"set rs = CreateRecordset(strSQL) This doesn''t work :strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON[_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2 ORDER BY[_RechPat].cod_patrim ASC"set rs = CreateRecordset(strSQL) Error Number : -2147467259Error Description : Unspecified Error (in french : Erreur non spécifiée)1. ORDER BY clauses work fine in some other recordsets.2. This SQL statement works fine ( i design and test my SQL queries with MSACCESS)3. Database is MS ACCESS 20004. Server = IIS 5.0 Any ideas ? 推荐答案 Peroq写道: 大家好 我不确定ASP是不是问题,但我的SQL语句对我来说似乎很好。 这很好用: strSQL =" SELECT [_RechPat]。* FROM _RechPat INNER JOIN NivPatri ON [_RechPat] .cod_niv = NivPatri.cod_niv WHERE NivPatri.position = 2" set rs = CreateRecordset(strSQL) 这不起作用: strSQL =" SELECT [_RechPat]。* FROM _RechPat INNER JOIN NivPatri ON [_RechPat] .cod_niv = NivPatri.cod_niv WHERE NivPatri.position = 2 ORDER BY [_RechPat] .cod_patrim ASC" 设置rs = CreateRecordset(strSQL) 错误编号:-2147467259 错误说明:未指定错误(法语:Erreur non spécifiée) 1. ORDER BY子句在其他一些记录集中工作正常。 2.此SQL语句工作正常(i设计用MS ACCESS测试我的SQL查询 3.数据库是MS ACCESS 2000 4.服务器= IIS 5.0 任何想法? Hi all I''m not sure ASP is the problem, but my SQL statement seems fine to me. This works fine : strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON [_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2" set rs = CreateRecordset(strSQL) This doesn''t work : strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON [_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2 ORDER BY [_RechPat].cod_patrim ASC" set rs = CreateRecordset(strSQL) Error Number : -2147467259 Error Description : Unspecified Error (in french : Erreur non spécifiée) 1. ORDER BY clauses work fine in some other recordsets. 2. This SQL statement works fine ( i design and test my SQL queries with MS ACCESS) 3. Database is MS ACCESS 2000 4. Server = IIS 5.0 Any ideas ? 第一步是response.write strsql所以你可以验证是否已经正确创建了sql 语句字符串。 如果response.written字符串是可以执行的有效sql语句 在Access Query Builder中没有问题,然后我怀疑是一个保留字 问题。尝试将cod_patrim字段名称括起来: ... [_RechPat]。[cod_patrim] ASC" HTH, Bob Barrows PS。我建议你不要在你的选择列表中使用*,因为ADO必须为了获得列名而额外访问数据库,这会损害 的性能。应用。您应该指定希望查询返回的列的名称 。 - Microsoft MVP - ASP / ASP.NET 请回复新闻组。我的From 标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。 The first step is to "response.write strsql" so you can verify that the sqlstatement string has been created correctly. If the response.written string is a valid sql statement that can be executedwith no problem in the Access Query Builder, then I suspect a reserved wordproblem. Try bracketing the cod_patrim field name: " ...[_RechPat].[cod_patrim] ASC" HTH,Bob BarrowsPS. I urge you to avoid using * in your select list, because ADO has to makean extra trip to the database to get the column names, impairing theperformance of the application. You should specify the names of the columnsyou wish the query to return.--Microsoft MVP -- ASP/ASP.NETPlease reply to the newsgroup. The email account listed in my Fromheader is my spam trap, so I don''t check it very often. You will get aquicker response by posting to the newsgroup. 我没有看到任何问题。我建议安装最新版本的MDAC 和/或确保你使用OLEDB驱动程序连接到你的数据库, 而不是ODBC。 /> Ray在工作 " Peroq" < FR ***** @ yahoo.com>在消息中写道 新闻:3f *********************** @ nan-newsreader-01.noos.net ... I don''t see any issues. I suggest installing the latest version of MDACand/or making sure you''re using an OLEDB driver to connect to your database,as opposed to ODBC. Ray at work "Peroq" <fr*****@yahoo.com> wrote in messagenews:3f***********************@nan-newsreader-01.noos.net...大家好 我不确定ASP是不是问题,但我的SQL语句对我来说似乎很好。 这很好用: strSQL =" SELECT [_RechPat]。* FROM _RechPat INNER JOIN NivPatri ON [_RechPat] .cod_niv = NivPatri.cod_niv WHERE NivPatri.position = 2" set rs = CreateRecordset(strSQL ) 这不起作用: strSQL =" SELECT [_RechPat]。* FROM _RechPat INNER JOIN NivPatri ON [_RechPat] .cod_niv = NivPatri.cod_niv WHERE NivPatri.position = 2 ORDER BY [_RechPat] .cod_patrim ASC" 设置rs = CreateRecordset(strSQL) 错误号:-2147467259 错误描述:未指定错误(法语:Erreurnonspécifiée) 1. ORDER BY子句在其他一些记录集中工作正常。 2.这个SQL语句工作正常(我用$设计和测试我的SQL查询b $ b MS ACCESS) 3.数据库是MS ACCESS 2000 4.服务器= IIS 5.0 任何想法? Hi all I''m not sure ASP is the problem, but my SQL statement seems fine to me. This works fine : strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON [_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2" set rs = CreateRecordset(strSQL) This doesn''t work : strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON [_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2 ORDER BY [_RechPat].cod_patrim ASC" set rs = CreateRecordset(strSQL) Error Number : -2147467259 Error Description : Unspecified Error (in french : Erreur non spécifiée) 1. ORDER BY clauses work fine in some other recordsets. 2. This SQL statement works fine ( i design and test my SQL queries withMS ACCESS) 3. Database is MS ACCESS 2000 4. Server = IIS 5.0 Any ideas ? 感谢鲍勃和雷的答案。 但目前,它仍然无法正常工作。 " Peroq" < FR ***** @ yahoo.com> écritdansle message de news:3f *********************** @ nan-newsreader-01.noos.net ... Thanks bob and ray for your answers. But for the moment, it still doesn''t work. "Peroq" <fr*****@yahoo.com> a écrit dans le message denews:3f***********************@nan-newsreader-01.noos.net...大家好 我不确定ASP是不是问题,但我的SQL语句对我来说似乎很好。 这个工作正常: strSQL =" SELECT [_RechPat]。* FROM _RechPat INNER JOIN NivPatri ON [_RechPat] .cod_niv = NivPatri.cod_niv WHERE NivPatri.position = 2" set rs = CreateRecordset(strSQL) 这不起作用: strSQL =" SELECT [_RechPat]。* FROM _RechPat INNER JOIN NivPatri ON [_RechPat] .cod_niv = NivPatri .cod_niv WHERE NivPatri.position = 2 ORDER BY [_RechPat] .cod_patrim ASC" 设置rs = CreateRecordset(strSQL) 错误号:-2147467259 错误描述:未指定的错误(法语:Erreurnonspécifiée) 1. ORDER BY子句在其他一些记录集中工作正常。 2.这个SQL语句工作正常(我设计和测试我的SQL查询 MS ACC ESS) 3.数据库是MS ACCESS 2000 4.服务器= IIS 5.0 任何想法? Hi all I''m not sure ASP is the problem, but my SQL statement seems fine to me. This works fine : strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON [_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2" set rs = CreateRecordset(strSQL) This doesn''t work : strSQL = "SELECT [_RechPat].* FROM _RechPat INNER JOIN NivPatri ON [_RechPat].cod_niv = NivPatri.cod_niv WHERE NivPatri.position=2 ORDER BY [_RechPat].cod_patrim ASC" set rs = CreateRecordset(strSQL) Error Number : -2147467259 Error Description : Unspecified Error (in french : Erreur non spécifiée) 1. ORDER BY clauses work fine in some other recordsets. 2. This SQL statement works fine ( i design and test my SQL queries withMS ACCESS) 3. Database is MS ACCESS 2000 4. Server = IIS 5.0 Any ideas ? 这篇关于ORDER BY子句有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 09:25