我有下一个代码,其工作方式如下:
从网址接收一些参数
将此数据插入称为客户端的表中
然后我选择客户表中引入的最后一个数据
最后,它尝试将此数据插入另一个称为用户的表中。
但我收到此错误:
“ 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")%>
最佳答案
您在SQL字符串的最后一个'之后缺少')'。但是我不确定为什么会收到这种错误消息。
关于asp-classic - “Microsoft VBScript运行时错误'800a000d''800a000d',我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15464347/