A
Andy
Which is the better method to retrieve data from a database (SQL Server
2000 or Oracle 9i)?
Does one of the following methods perform better than the other?
'METHOD 1
Dim strSql, strValue
strSql = "SELECT X FROM MyTable WHERE Y = '" something "'"
Set rs = conn.Execute(strSql)
strValue = rs("STATUSDATE")
rs.Close
Set rs = nothing
Response.Write(strValue)
'METHOD 2
Dim strValue
Set rs = conn.Execute("SELECT X FROM MyTable WHERE Y = '" something "'")
strValue = rs("STATUSDATE")
rs.Close
Set rs = nothing
Response.Write(strValue)
The conn object is created this way:
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open Application("connstring")
2000 or Oracle 9i)?
Does one of the following methods perform better than the other?
'METHOD 1
Dim strSql, strValue
strSql = "SELECT X FROM MyTable WHERE Y = '" something "'"
Set rs = conn.Execute(strSql)
strValue = rs("STATUSDATE")
rs.Close
Set rs = nothing
Response.Write(strValue)
'METHOD 2
Dim strValue
Set rs = conn.Execute("SELECT X FROM MyTable WHERE Y = '" something "'")
strValue = rs("STATUSDATE")
rs.Close
Set rs = nothing
Response.Write(strValue)
The conn object is created this way:
Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open Application("connstring")