numbenator
18 Aug 2005, 03:24 AM
Hi There,
Im doing a lot of access to a db and retrieval of all informaiton in numerous tables. Now i know that should be using stored procedures bu i am trying to get my head into functions and thus have the below question.
Ive created a function shown below called getALL. I want it to return a recordset so as I can then process the information retrieved.
In my sub, how do i use this function and continue processing after the retrieval of the recordset. I start erroring when i attempt to code use and though sumone could look over.
cheers
my function which is defined in a SSI
Conn (the connection) is defined in another SSI.
function getAll(tableName)
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM "&dbName
RS.Open strSQL, Conn
getAll=RS
end function
sub getSelectTable(tableName)
tabN=tableName
function call here i assume
RS.MoveFirst
'process recordset here
Im doing a lot of access to a db and retrieval of all informaiton in numerous tables. Now i know that should be using stored procedures bu i am trying to get my head into functions and thus have the below question.
Ive created a function shown below called getALL. I want it to return a recordset so as I can then process the information retrieved.
In my sub, how do i use this function and continue processing after the retrieval of the recordset. I start erroring when i attempt to code use and though sumone could look over.
cheers
my function which is defined in a SSI
Conn (the connection) is defined in another SSI.
function getAll(tableName)
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM "&dbName
RS.Open strSQL, Conn
getAll=RS
end function
sub getSelectTable(tableName)
tabN=tableName
function call here i assume
RS.MoveFirst
'process recordset here