In a simple page in VB ASP.NET I get an error with the connection to SQL:
OLE DB multi-step operation generated errors. Check the OLE DB status values if possible. No work was done.
I am new to the VB language, here is a sample of my code
<%@ Page aspcompat=true Language="vb" AutoEventWireup="false" CodeBehind="buscar.aspx.vb" Inherits="buscador_yuyin.WebForm1" %>
Seeker
Results obtained with <%=Request("Word") %>
<%
Dim Conexion, Tabla
Conexion = Server.CreateObject("adodb.connection")
Tabla = Server.CreateObject("adodb.recordset")
Conexion.ConnectionString = "PROVIDER=SQLOLEDB;Data Source=TEST-PC\VIRTUAL;DATABASE=prueba;Integrated Security=True"
Conexion.open()
Dim Temp
Temp = "Select * From busqueda('" & Request("palabra") & ")'"
Tabla.Open(Temp, Conexion)
If Tabla.BOF And Tabla.EOF Then
%>
<p><font face="Tahoma" size="2">No se ha encontrado nada con <strong><%=Request("palabra")%></strong> en la Base de Datos</font></p>
<%
Else
%>
<div align="center"><center>
<table border="1" cellpadding="0" cellspacing="0" width="100%" height="74" bordercolor="#C0C0C0">
<tr>
<td width="28%" height="19">
<p align="center"><strong><font face="Tahoma" size="2">Categoria</font></strong>
</td>
<td width="28%" height="19">
<p align="center"><strong><font face="Tahoma" size="2">Producto</font></strong></p>
</td>
<td width="52%" height="19">
<p align="center"><strong><font face="Tahoma" size="2">Descripcion</font></strong>
</td>
<td width="19%" height="19">
<p align="center"><strong><font face="Tahoma" size="2">Url</font></strong></p>
</td>
</tr>
<% While Not Tabla.EOF%>
<tr>
<td width="28%" bgcolor="#FFCC00" height="51">
<p align="center"><font face="Tahoma" size="2"><%=Tabla.Fields("Categoria")%></font></td>
<td width="28%" bgcolor="#FFCC00" height="51">
<p align="center"><font face="Tahoma" size="2"><%=Tabla.Fields("Nombre")%></font></td>
<td width="52%" bgcolor="#FFCC00" height="51">
<p align="center"><font face="Tahoma" size="2"><%=Tabla.Fields("Descripcion")%></font></td>
<td width="19%" bgcolor="#FFCC00" height="51">
<p align="center"><a href="<%=Tabla.Fields("url")%>"><font face="Tahoma" size="2">Img</font></a>
</tr>
<%
Tabla.MoveNext
End While
Tabla.Close
Conexion.Close
End If
%>
</table>
</center></div>
<p align="center"><font face="Tahoma" size="2">Busquedas</font></p>
<p align="center"><font face="Tahoma" size="2">2002</font></p>
<p align="center"> </p>
</body>
I'm not sure, but it seems that you have a detail in this line:
applying the fix:
I don't know if that quote affects him, how would the
string
ending be?Are you calling a function? Or why is it like this? Because if you are using SQL, it should be something like:
In your case, I don't know what the name of the field is but assuming it is called word:
I add that according to the error:
It may be because the connection or the query have some detail, it may be an inconsistency between the different types of data, etc., first validate what I tell you, if you have the code example to share, some .zip or .rar could help better. Greetings.
It is as Cristina indicates, the error is in your query:
Should be:
EITHER: