Hi there,
I wass just wondering which way is the fastest and/or most efficent way of recalling data from a DB.
My setup at work is a Sql Server 7 DB and I use ASP to communicate with it, I also use Ultradev. I don't like having lots of unnecesary code and I find that Ultradev does this sometimes so instead of using it's built in functions using command parameters and such like I use this method...
Dim Conn 'Database Connnection
Dim RsN 'Recordset for the News
Dim Sql 'Sql Code variable
Set Conn = Server.CreateObject("ADODB.Connection"
Set RsN = Server.CreateObject("ADODB.Recordset"
Conn.Open MyConnection
Sql = "SELECT newsID, " _
& "newsText, " _
& "newsDate " _
& "FROM news "_
& "ORDER BY newsDate DESC"
SET RsN = Conn.Execute(Sql)
I understand that using a Stored Procedure might be quicker, but for this example I wanted to write out the fields individually so I could see them on the page.
Also I understand that it's quicker to write out each field that you want selected instead of just using * is this true?
What methods do other people use to grab data from a DB for their recordsets?
I wass just wondering which way is the fastest and/or most efficent way of recalling data from a DB.
My setup at work is a Sql Server 7 DB and I use ASP to communicate with it, I also use Ultradev. I don't like having lots of unnecesary code and I find that Ultradev does this sometimes so instead of using it's built in functions using command parameters and such like I use this method...
Dim Conn 'Database Connnection
Dim RsN 'Recordset for the News
Dim Sql 'Sql Code variable
Set Conn = Server.CreateObject("ADODB.Connection"
Set RsN = Server.CreateObject("ADODB.Recordset"
Conn.Open MyConnection
Sql = "SELECT newsID, " _
& "newsText, " _
& "newsDate " _
& "FROM news "_
& "ORDER BY newsDate DESC"
SET RsN = Conn.Execute(Sql)
I understand that using a Stored Procedure might be quicker, but for this example I wanted to write out the fields individually so I could see them on the page.
Also I understand that it's quicker to write out each field that you want selected instead of just using * is this true?
What methods do other people use to grab data from a DB for their recordsets?