“Microsoft VBScript运行时错误'800a000d''800a000d'

时间:2013-03-17 18:14:26

标签: asp-classic vbscript

我有下一个代码,其工作原理如下:

  1. 从网址
  2. 接收一些参数
  3. 将此数据插入名为clients
  4. 的表中
  5. 然后我选择在clients表中引入的最后一个数据
  6. 最后,它尝试将此数据插入另一个名为users的表中。
  7. 但是我收到了这个错误:

    “Microsoft VBScript运行时错误'800a000d''800a000d'

    类型不匹配:'[string:“INSERT INTO galileo。”]'

    /createClient.asp,第50行

    第50行是这一行:

     <%
        Dim insertaUsuario
        Set insertaUsuario = Server.CreateObject("ADODB.Recordset")
        insertaUsuario.ActiveConnection = MM_trucks_STRING
        '" + Replace(posicionFechaFin__MMColParam, "'", "''") + "'
        insertaUsuario.Source = "INSERT INTO galileo.users (email,password,clientid) values ('"+(selecciona.Fields.Item("email").Value)+"','"+(selecciona.Fields.Item("password").Value)+"', '" + (selecciona.Fields.Item("id").Value)+ "'"
        insertaUsuario.Open()
        %>
    

    这是完整的代码:

        <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
        <!--#include file="connects/global.asp" -->
        <%
        Dim inserta__MMColParamEmail
        inserta__MMColParamEmail = "1"
        If (Request.QueryString("email") <> "") Then 
          inserta__MMColParamEmail = Request.QueryString("email")
        End If
        %>
        <%
        Dim inserta__MMColParamPassword
        inserta__MMColParamPasswordd = "1"
        If (Request.QueryString("password") <> "") Then 
          inserta__MMColParamPassword = Request.QueryString("password")
        End If
        %>
    
        <%
        Dim inserta
        Set inserta = Server.CreateObject("ADODB.Recordset")
        inserta.ActiveConnection = MM_trucks_STRING
        '" + Replace(posicionFechaFin__MMColParam, "'", "''") + "'
        inserta.Source = "INSERT INTO galileo.clients (email,password) values ('" + Replace(inserta__MMColParamEmail, "'", "''") + "','" + Replace(inserta__MMColParamPassword, "'", "''") + "')"
        inserta.Open()
        %>
        <%
    
        Dim selecciona
        Dim selecciona_numRows
    
        Set selecciona = Server.CreateObject("ADODB.Recordset")
        selecciona.ActiveConnection = MM_trucks_STRING
        selecciona.Source = "SELECT id, email, password from clients where email='" + Replace(inserta__MMColParamEmail, "'", "''") + "' and password='" + Replace(inserta__MMColParamPassword, "'", "''") + "'"
        selecciona.CursorType = 0
        selecciona.CursorLocation = 2
        selecciona.LockType = 1
        selecciona.Open()
    
        selecciona_numRows = 0
        %>
        <%= (selecciona.Fields.Item("id").Value)%>, <%= (selecciona.Fields.Item("email").Value) %>, <%= (selecciona.Fields.Item("password").Value) %>
    
    
        <%
        Dim insertaUsuario
        Set insertaUsuario = Server.CreateObject("ADODB.Recordset")
        insertaUsuario.ActiveConnection = MM_trucks_STRING
        '" + Replace(posicionFechaFin__MMColParam, "'", "''") + "'
        insertaUsuario.Source = "INSERT INTO galileo.users (email,password,clientid) values ('"+(selecciona.Fields.Item("email").Value)+"','"+(selecciona.Fields.Item("password").Value)+"', '" + (selecciona.Fields.Item("id").Value)+ "'"
        insertaUsuario.Open()
        %>
    
        <!--If it is all ok, it redirects-->
        <% Response.redirect ("default.asp")%>
    

1 个答案:

答案 0 :(得分:3)

你在SQ​​L字符串中的最后一个'之后缺少')'。但我不确定为什么你会收到这种错误信息。