[AccessD] DAO Query

Nancy Lytle nancy.lytle at auatac.com
Thu Sep 18 10:35:29 CDT 2003


How about oDB.OpenRecordset(qryName) instead of
oDb.OpenRecordset(Name:=qryName)

Nancy 


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Sad Der
Sent: Thursday, September 18, 2003 9:44 AM
To: Acces User Group

Hi group,

I've got a function called GetStatus. It was created by Bruce (from this
list) and used to be in ADO. I made changes so that it would now run in DAO.

Somehow the function doesn't work. At the line:
 Set rst = oDb.OpenRecordset(Name:=qryName)

I get the error:
3061 too few parameters Expected 1

However I call it like this:
    gstrSwitchStatus = GetStatus("qrySwitchStatus")

Any ideas?

TIA

SD

Public Function GetStatus(qryName As String) As String

 '
 ' Description / Purpose :-
 ' GetStatus executes a stored database query that returns a status  ' The
query MUST return only one row, and only one Field "qryStatus".
 '
 ' Parameters:-
 ' PARAMETER TYPE COMMENTS
 ' qryName string The name of the select query to be run  '
' ' Version Dated Author Comment
' ' 1.0 28/06/2003 bruce Original.


 Dim strRtn As String
 Dim oDb As DAO.Database
 Dim rst As DAO.Recordset 'recordset returned by the
query

 On Error GoTo GetCount_ERR

 'lngRtn = -1
 strRtn = "FAILED"
 
 'Set conn = CurrentProject.Connection
 'Set rst = New Recordset
 Set oDb = CurrentDb()
 Set rst = oDb.OpenRecordset(Name:=qryName) ',
Type:=dbOpenSnapshot, Options:=dbOpenForwardOnly)

....
....
end function
 

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
 



More information about the AccessD mailing list