[AccessD] Elegant Solution?

DWUTKA at marlow.com DWUTKA at marlow.com
Fri Sep 24 08:29:47 CDT 2004


I was implying the sql statement:

Function OpenRS(ByRef rs AS DAO.Recordset, ByVal strSQL as String)

End Function

Works either way.....

Drew

-----Original Message-----
From: Steve Conklin (Developer at UltraDNT) [mailto:Developer at ultradnt.com]
Sent: Friday, September 24, 2004 7:38 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Elegant Solution?


I *think* he means the opposite ... That is, he needs to set up a
function that takes in the SQL statement and returns an RS.

Steve

Public function ReturnRS (stSQL as string) as DAO.recordset
' not debating these specifics:
' Could use:
' Set ReturnRS= currentdb.openrecordset(stSQL,dbopensnapshot)
End function


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
DWUTKA at marlow.com
Sent: Friday, September 24, 2004 8:12 AM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] Elegant Solution?


Put the code in a module, and send the recordset through as an agrument
ByRef.

Drew

-----Original Message-----
From: ACTEBS [mailto:actebs at actebs.com.au]
Sent: Friday, September 24, 2004 2:13 AM
To: access group
Subject: [AccessD] Elegant Solution?


Hi Everyone,
 
Does anyone have any code or such that handles the following elegantly:
 
Dim dbs as DAO.Database
Dim rst as DAO.Recordset
 
Set dbs etc etc
 
Do whatever here
 
dbs.close
dbs = nothing etc etc
 
I am tired of having do the above to open database connections and
recordsets in the above manner in every Sub or Function. Surely there's
a  more elegant method that someone has come up with here you just parse
the SQL Statement through or something...
 
Any suggestions or links will be greatly appreciated...
 
Regards
Vlad
 
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list