简体   繁体   English

迁移问题:ASP经典应用程序中的错误“ 80040e14”从Windows Server 2003 / SQL Server 2000迁移到Windows Server 2008 R2 / SQL Server 2012

[英]Migration Issue: error '80040e14' in ASP classic application from Windows server 2003/SQL Server 2000 to Windows Server 2008 R2/SQL Server 2012

First of all I want you to know that I'm not an engineer, I'm just a web designer working within the constraints of my job. 首先,我想让您知道我不是工程师,我只是一个在工作限制内工作的网页设计师。 We have a bunch of applications made in ASP classic running in a Windows server 2003 / SQL 2000 environment. 我们有一堆以ASP classic制作的应用程序,它们在Windows Server 2003 / SQL 2000环境中运行。 The company buy a new server with Windows server 2008R2 and SQL 2012 and they give me the task of migrate the applications to the new server. 该公司购买了带有Windows Server 2008R2和SQL 2012的新服务器,他们为我提供了将应用程序迁移到新服务器的任务。 I read and read a lot of manuals and docs about this for weeks and I fulfilled my task except for one of the apps. 我阅读并阅读了许多有关此问题的手册和文档,为期数周,除其中一个应用程序外,我完成了我的任务。 The app produces and creates and interface to answer surveys. 该应用程序可生成并创建界面并回答调查。 It is quite strange because the login page works: you put your user name and pass and you enter to the admin area and the options stored in the database shows without problem but when I try to enter to a survey to answer it the browser gives me this: 这很奇怪,因为登录页面有效:您输入用户名并通过,然后进入管理区域,存储在数据库中的选项显示没有问题,但是当我尝试输入调查问卷回答浏览器时,这个:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14' Microsoft OLE DB提供程序的ODBC驱动程序错误'80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '@errno'. [Microsoft] [ODBC SQL Server驱动程序] [SQL Server]'@ errno'附近的语法不正确。

/SEL/Encuesta/preguntatodo_nuevo.asp, línea 108 /SEL/Encuesta/preguntatodo_nuevo.asp,利纳(Línea)108

Well here is what i found in /SEL/Encuesta/preguntatodo_nuevo.asp, línea 108: 好吧,这是我在lnea的/SEL/Encuesta/preguntatodo_nuevo.asp中找到的东西:

sSQL = "Update UsuariosClima set NumCuestContestados = NumCuestContestados+1 Where IDUsuario = " & IDUsuario
conn.Execute(sSQL)

I know it's difficult to help me with just this information, so if you need more data please tell me. 我知道很难仅凭这些信息来帮助我,所以如果您需要更多数据,请告诉我。 I don't want you to do my work, if some one can just lead me to the right direction I'll continue by myself. 我不希望您去做我的工作,如果有人可以带领我朝正确的方向前进,我将自己继续。 Thank you very very much. 非常非常感谢你。

Please remember: I am not an egineer, explain it to me like I was a child. 请记住:我不是一个egineer,像我小时候向我解释。

UPDATE - Triggers in UsuariosClima: 更新-UsuariosClima中的触发器:

tD_Usuarios: tD_Usuarios:

ALTER trigger tD_Usuarios on dbo.UsuariosClima for DELETE as

begin
declare  @errno   int,
       @errmsg  varchar(255)

if exists (
  select * from deleted,AccesoCuestionarioClima
  where

    AccesoCuestionarioClima.IDUsuario = deleted.IDUsuario
)
begin
  select @errno  = 30001,
         @errmsg = 'Cannot DELETE "Usuarios" because "AccesoCuestionario" exists.'
  goto error
end

if exists (
  select * from deleted,AccesoClienteClima
  where

    AccesoClienteClima.IDUsuario = deleted.IDUsuario
)
begin
  select @errno  = 30001,
         @errmsg = 'Cannot DELETE "Usuarios" because "AccesoCliente" exists.'
  goto error
end

if exists (
  select * from deleted,PertenenciaClima
  where

    PertenenciaClima.IDUsuario = deleted.IDUsuario
)
begin
  select @errno  = 30001,
         @errmsg = 'Cannot DELETE "Usuarios" because "Pertenencia" exists.'
  goto error
end

update RespuestaCuestionariosClima
  set

    RespuestaCuestionariosClima.IDUsuario = NULL
  from RespuestaCuestionariosClima,deleted
  where

    RespuestaCuestionariosClima.IDUsuario = deleted.IDUsuario

return
error:
raiserror @errno @errmsg
rollback transaction
end

tU_Usuarios: tU_Usuarios:

ALTER trigger tU_Usuarios on dbo.UsuariosClima for UPDATE as
begin
  declare  @numrows int,
       @nullcnt int,
       @validcnt int,
       @insIDUsuario int,
       @errno   int,
       @errmsg  varchar(255)
  select @numrows = @@rowcount

  if

    update(IDUsuario)
  begin
    if exists (
      select * from deleted,AccesoCuestionarioClima
      where

    AccesoCuestionarioClima.IDUsuario = deleted.IDUsuario
)
begin
  select @errno  = 30005,
         @errmsg = 'Cannot UPDATE "UsuariosClima" because "AccesoCuestionarioClima" exists.'
  goto error
end
  end

  if

update(IDUsuario)
  begin
if exists (
  select * from deleted,AccesoClienteClima
  where

    AccesoClienteClima.IDUsuario = deleted.IDUsuario
)
begin
  select @errno  = 30005,
         @errmsg = 'Cannot UPDATE "UsuariosClima" because "AccesoClienteClima" exists.'
  goto error
end
  end

  if

update(IDUsuario)
  begin
if exists (
  select * from deleted,PertenenciaClima
  where

    PertenenciaClima.IDUsuario = deleted.IDUsuario
)
begin
  select @errno  = 30005,
         @errmsg = 'Cannot UPDATE "UsuariosClima" because "PertenenciaClima" exists.'
  goto error
end
  end

  if

update(IDUsuario)
  begin
update RespuestaCuestionariosClima
  set

    RespuestaCuestionariosClima.IDUsuario = NULL
  from RespuestaCuestionariosClima,deleted
  where

    RespuestaCuestionariosClima.IDUsuario = deleted.IDUsuario
end

return
error:
raiserror @errno @errmsg
rollback transaction
end

At first glance, I believe the first error you describe may be nothing more than a syntax error in the call to raiserror in the tU_Usarios trigger. 乍一看,我相信您描述的第一个错误可能只是在tU_Usarios触发器中对raiserror的调用中的语法错误。 I believe this is being reflected as an error in "Line 108" above because the update is what's causing the error, but the code that calls the RAISERROR bubbles the problem back to the originating statement. 我相信这在上面的“第108行”中被反映为错误,因为更新是导致该错误的原因,但是调用RAISERROR的代码将问题回溯到原始语句。 When the Update occurs, the trigger fires, an error occurs in the trigger code that is caught, but when control passes to the code that calls RAISERROR, the syntax error arises at "@errno". 当更新发生时,触发器将触发,捕获的触发器代码中发生错误,但是当控制权传递给调用RAISERROR的代码时,语法错误出现在“ @errno”。

I believe the arguments to RAISERROR need to be provided in a comma delimited list, contained within parentheses, etc. And I believe the minimum number of parameters is three - a message id or string, followed by a severity code, and then a state code. 我认为需要在逗号分隔的列表中提供RAISERROR的参数,并将其包含在括号中,等等。并且我相信参数的最小数量为三个-消息ID或字符串,其后是严重性代码,然后是状态代码。 Mostly, those last two values end up being something like 16 and 1, respectively. 通常,最后两个值最终分别为16和1。

I put the answer here to make it more visible. 我把答案放在这里以使其更明显。 Thanks. 谢谢。

Since they are migrating to SQL server 2012, both triggers (The update and the delete) should be changed from RAISERROR to THROW To do this, he should change the line (in both) to THROW @errno, @errmsg,2; 由于它们都将迁移到SQL Server 2012,因此应将两个触发器(更新和删除)都从RAISERROR更改为THROW。为此,他应将行(在两者中)更改为THROW @errno,@ errmsg,2; – Ghost –鬼

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server错误'80040e14'列名不明确 - SQL Server error '80040e14' Ambiguous column name 经典ASP Microsoft SQL Server本机客户端11.0错误'80040e14'用户登录失败,但不是我指定的用户登录 - Classic ASP Microsoft SQL Server Native Client 11.0 error '80040e14' Login failed for user, but not the one I specified 尝试从 SQL Server 检索数据时出现 VBA ADODB 错误 (80040e14) - VBA ADODB error (80040e14) when trying to retrieve data from SQL Server SQL Server 2000到SQL Server 2008 R2的迁移 - SQL Server 2000 to SQL Server 2008 R2 migration SQL Server的Microsoft OLE DB提供程序错误'80040e14'无效的列名。 SQL查询 - Microsoft OLE DB Provider for SQL Server error '80040e14' Invalid column name . SQL query SQL Server错误“ 80040e14”,语法错误在“ ORDER”附近 - SQL Server error '80040e14' with syntax error nearby “ORDER” 在Windows Server 2003 Enterprise Edition上并排安装SQL Server 2008 R2和MySQL是否安全? - Is it safe to install SQL Server 2008 R2 and MySQL side-by-side on Windows Server 2003 Enterprise Edition? 将 SQL Server 2008 R2 升级到 2012 - Upgrade SQL Server 2008 R2 to 2012 SQL SERVER 2008 R2与SQL SERVER 2012 - SQL SERVER 2008 R2 Vs SQL SERVER 2012 如何在C#中将图像从SQL Server 2008 R2检索到Datagridview [Windows应用程序] - How to retrieve image from SQL Server 2008 R2 to Datagridview in C# [Windows Application]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM