ola ta ai o pedaço da conexão que faz uma busca na tabela Set objCon = Server.CreateObject("ADODB.Connection")
objCon.Open strCon
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.CursorLocation = 3
objRS.CursorType = 2
objRS.LockType = 1
objRS.CacheSize = RegPorPag
strQ = "SELECT * FROM vendas"
If Trim(Request("string_busca")) <> "" Then
If Trim(Request("campo_busca")) <> "" Then
strQ = strQ & " Where " & Trim(Request("campo_busca")) & " LIKE '%" & Trim(Request("string_busca")) & "%'"
Else
strQ = strQ & " Where 1 <> 1"
strQ = strQ & " Or id_venda LIKE '%" & Trim(Request("string_busca")) & "%'"
strQ = strQ & " Or id_cliente LIKE '%" & Trim(Request("string_busca")) & "%'"
strQ = strQ & " Or Nome LIKE '%" & Trim(Request("string_busca")) & "%'"
strQ = strQ & " Or produtos LIKE '%" & Trim(Request("string_busca")) & "%'"
strQ = strQ & " Or preço LIKE '%" & Trim(Request("string_busca")) & "%'"
End If
End If
If Trim(Request.QueryString("Ordem")) <> "" Then
strQ = strQ & " ORDER BY " & Request.QueryString("Ordem")
End If
objRS.Open strQ, objCon, , , &H0001
objRS.PageSize = RegPorPag
Set objRS_indice = Server.CreateObject("ADODB.Recordset")
objRS_indice.CursorLocation = 2
objRS_indice.CursorType = 0
objRS_indice.LockType = 2
strQ_indice = "SELECT * FROM vendas WHERE 1 <> 1"
objRS_indice.Open strQ_indice, objCon, , , &H0001
indice = ""
For Each item In objRS_indice.Fields
If item.properties("IsAutoIncrement") = True Then
indice = item.name
Exit For
End If
Next
objRS_indice.Close
Set objRS_indice = Nothing
Set strQ_indice = Nothing
Set objRS.ActiveConnection = Nothing
objCon.Close
Set objCon = Nothing
%> vlw!!!!!!