|
-
January 10th, 2006, 03:53 PM
#1
Access query [Urgent Help Please]
Hi, this both a VB and an SQL question.
I have an access database that I have created querys, which run perfectly well in access.
I have also tried using this query in vb to open a data report, but it doesn't work.
I am using the following code to open the report...
Code:
Call connectDB
rs.Open "SELECT Sum(ServiceClaim.Live) AS SumOfLive, Sum(ServiceClaim.Dead) AS SumOfDead, SumOfLive+SumOfDead as Total From ServiceClaim"
Set rptSection1a.Datasource = rs
rptSection1a.show
When I run this code I get the following message...
Run-time error '3709':
The connection cannot be used to perform this operation. It is either closed or invalid in this context.
The method of setting the record set and calling the report does work as I've used it on a different query.
I don't understand why/how the code is falling down in vb but not in access, when it is using the same sql code.
Any advice on either my codeing or a better way would be greatly appreciated.
Thanks
Satkin2
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|