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

Database

 
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 
AnswerRe: SQL Query Pin
andyharman2-Feb-07 5:56
professionalandyharman2-Feb-07 5:56 
Your code should use:
... " WHERE " & FieldHead & " LIKE '" & Replace(TextBox, "'", "''") & "%'
Instead of:
... " WHERE " & FieldHead & " LIKE '" & TextBox & "%'"
Otherwise it will break if the user enters a single-quote into his search value.

The normal way to show the results is to iterate through each row and column in the result set. However, you might find the following faster:
'Open the recordset and render the data in HTML format.
For Each objField In objRS.Fields
   Call Response.Write("<td nowrap><b>" & _
         Server.HtmlEncode(objField.Name) & "</b></td>" & vbCRLF)
Next
Call Response.Write("</tr>" & vbCRLF)
Call Response.Write("<tr>")
If Not objRs.eof Then
   strData = objRS.GetString( , , "#<#/td#>##<#td#>#", _
         "#<#/td#>##<#/tr#>##<#tr#>##<#td nowrap#>#", "#&#nbsp;")
   strData = Replace(Replace(Replace(strData, "#&#", Chr(1)), "&", "&amp;"), Chr(1), "&")
   strData = Replace(Replace(Replace(strData, "#<#", Chr(1)), "<", "&lt;"), Chr(1), "<")
   strData = Replace(Replace(Replace(strData, "#>#", Chr(1)), ">", "&gt;"), Chr(1), ">")
   strData = "<td>" & Replace(Left(strData, Len(strData) - 15), "</tr>", "</tr>" & vbCRLF)
   Call Response.Write(strData)
Else
   Call Response.Write("<td colspan=""" & objRs.Fields.Count & """>No records found.</td></tr>" & vbCRLF)
End If
Call Response.Write("</table>" & vbCRLF)
The funny replace stuff is a quick way to get it to render each field as a separate HTML table cell.

Andy
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 
QuestionNoise words issue in full text seach Sql server 2000 Pin
vivek_r1-Feb-07 19:19
vivek_r1-Feb-07 19:19 

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.