Click here to Skip to main content
15,888,461 members
Home / Discussions / Database
   

Database

 
QuestionSample application Pin
CoolOT3-Feb-07 7:25
CoolOT3-Feb-07 7:25 
AnswerRe: Sample application Pin
User 17164923-Feb-07 8:10
professionalUser 17164923-Feb-07 8:10 
QuestionReading Return Val from SP Called from VB.NET? Pin
Justin Cooke2-Feb-07 7:05
Justin Cooke2-Feb-07 7:05 
AnswerRe: Reading Return Val from SP Called from VB.NET? Pin
Colin Angus Mackay2-Feb-07 8:47
Colin Angus Mackay2-Feb-07 8:47 
QuestionSql Server query syntax needed Pin
Saira Tanwir2-Feb-07 6:56
Saira Tanwir2-Feb-07 6:56 
AnswerRe: Sql Server query syntax needed Pin
Colin Angus Mackay2-Feb-07 8:38
Colin Angus Mackay2-Feb-07 8:38 
AnswerRe: Sql Server query syntax needed Pin
PIEBALDconsult2-Feb-07 8:43
mvePIEBALDconsult2-Feb-07 8:43 
QuestionSQL Query Pin
Tyrone_whitey2-Feb-07 5:00
Tyrone_whitey2-Feb-07 5:00 
I have a database that a user can search for using the begins with, exact match, or contains option. I did a request.querystring to pull in that information from the previous page where the user selects one of those options and types is what he is searching for. The problem is that I cannot figure out how to display the users result when they select to search by exact match, begins with, or contains. The following is the code that I used. Can anyone tell me what is wrong with it and give me some leads on how to get it fixed.



<title>Table Display

<%Dim FieldHead, SearchMethod, TextBox, Table, DB, RS, strSql%>

<%'Request the information from the previous page'%>
<%FieldHead = Request.QueryString("fieldhead")
SearchMethod = Request.QueryString("SrchMthd")
TextBox = Request.QueryString("textbox")
Table = Request.QueryString("Table")
%>


<%'search method if the user selects begins with%>
<%If SearchMethod = "begin" Then%>
<%Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= C:\Inetpub\wwwroot\ASP\ThomasTate\North.mdb")

Set RS = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT * FROM " & Table " WHERE " & FieldHead & " LIKE '" & TextBox & "%'"
RS.Open (strSql), DB







End IF
%>

<%'search method if the user selects contains%>
<%If SearchMethod = "contain" Then%>
<%Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= C:\Inetpub\wwwroot\ASP\ThomasTate\North.mdb")

Set RS = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT * FROM " & Table " WHERE " & FieldHead & " LIKE '%" & TextBox & "%'"
RS.Open (strSql), DB








End IF%>

<%'search method if the user selects exact match%>
<%If SearchMethod = "exact" Then%>
<%Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= C:\Inetpub\wwwroot\ASP\ThomasTate\North.mdb")

Set RS = Server.CreateObject("ADODB.Recordset")
strSql = "SELECT * FROM " & Table " WHERE " & FieldHead & = TextBox
RS.Open (strSql), DB
End IF%>


Ty

AnswerRe: SQL Query Pin
andyharman2-Feb-07 5:56
professionalandyharman2-Feb-07 5:56 
QuestionProblems with a delete TSQL statement Pin
matthias s.2-Feb-07 3:18
matthias s.2-Feb-07 3:18 
AnswerRe: Problems with a delete TSQL statement Pin
Colin Angus Mackay2-Feb-07 3:38
Colin Angus Mackay2-Feb-07 3:38 
GeneralRe: Problems with a delete TSQL statement Pin
matthias s.2-Feb-07 3:56
matthias s.2-Feb-07 3:56 
AnswerRe: Problems with a delete TSQL statement Pin
Frank Kerrigan2-Feb-07 5:50
Frank Kerrigan2-Feb-07 5:50 
QuestionReferences in SQL Server Project Pin
Brady Kelly2-Feb-07 2:18
Brady Kelly2-Feb-07 2:18 
Questionregarding debug Pin
aslamshaik25109782-Feb-07 1:27
aslamshaik25109782-Feb-07 1:27 
QuestionDoes Oracle how much Rule follow codd’s rules? Pin
PavanPareta2-Feb-07 1:17
PavanPareta2-Feb-07 1:17 
QuestionAccessing SQL Servers in the DMZ Pin
Stone Free2-Feb-07 1:07
Stone Free2-Feb-07 1:07 
QuestionAdd or edit records Pin
CoolOT2-Feb-07 0:59
CoolOT2-Feb-07 0:59 
AnswerRe: Add or edit records Pin
Pete O'Hanlon2-Feb-07 5:00
mvePete O'Hanlon2-Feb-07 5:00 
QuestionHow to perform rollback feature for SQLyog? Pin
cheeken2u1-Feb-07 23:15
cheeken2u1-Feb-07 23:15 
AnswerRe: How to perform rollback feature for SQLyog? Pin
cheeken2u4-Feb-07 16:33
cheeken2u4-Feb-07 16:33 
QuestionSSIS Programme Flatfile source and DB destination Pin
NK71-Feb-07 22:42
NK71-Feb-07 22:42 
QuestionSQL 2005 Express Pin
Illegal Operation1-Feb-07 21:43
Illegal Operation1-Feb-07 21:43 
AnswerRe: SQL 2005 Express Pin
andyharman1-Feb-07 22:31
professionalandyharman1-Feb-07 22:31 
QuestionHelp : I have a one corore or more Rows in SQL Server Table on Client PC ..? Pin
PavanPareta1-Feb-07 20:22
PavanPareta1-Feb-07 20:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.