Error 430 problem when using CopyFromRecordset method (cont'd)

G

Guest

Hi all,

I posted this a few days ago, but lost connection to the newsgroups for some
reason (how does everyone else access the microsoft public newsgroups?).
Since I wasn't able to respond quickly at that point, I wanted to post again
to see if anyone could help.

I did get one response saying to use .CopyFromRecordset rs instead of
..CopyFromRecordset (rs), but that didn't help.

Anyway... (original post follows)

Using Access2000, Excel2000, DAO3.6 (version 3.60.3714.5 and 3.60.8618.0)

I created some Excel automation which, up until Friday, was working fine.
Now, I get the error "Runtime error: 430/ class does not support automation
or does not support expected interface"

It fails on the copyfromrecordset method.

Here is the relevant code:
Dim objexcel As Excel.Application
Dim objwkb As Excel.Workbook
Dim objsht As Excel.Worksheet
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set objexcel = New Excel.Application
Set objwkb = objexcel.Workbooks.Open(strTemplateFileName)
objwkb.Sheets("Data").Visible = True

Set objsht = objwkb.Worksheets("Enrollment")
objsht.Select
With objsht
Set rs = db.OpenRecordset("001 Qry Pipeline Enrollment")
.Cells(2, 1).CopyFromRecordset rs '<----fails here!!!
.Cells(1, 1).Select
End With
rs.Close
Set rs = Nothing

Our company did a security push, but I'm not sure what exactly went out and
if it's the cause of this issue (seems like it would be) or just
coincidental. When I googled for an answer, they said it might be a
DAO360.dll issue, but I'm not using the version they say has a bug in it.

Any ideas?
Thanks!
-Mark
 
D

David Lloyd

Mark:

I did receive Error 430 when I ran your code with the recordset object in
parentheses. After removing the parentheses I was able to use your code
successfully without error.

I am running DAO version 3.60.8618. You cited two different versions of
DAO. Can you explain why you are using two, or at least referencing two,
different DAO versions?

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi all,

I posted this a few days ago, but lost connection to the newsgroups for some
reason (how does everyone else access the microsoft public newsgroups?).
Since I wasn't able to respond quickly at that point, I wanted to post again
to see if anyone could help.

I did get one response saying to use .CopyFromRecordset rs instead of
..CopyFromRecordset (rs), but that didn't help.

Anyway... (original post follows)

Using Access2000, Excel2000, DAO3.6 (version 3.60.3714.5 and 3.60.8618.0)

I created some Excel automation which, up until Friday, was working fine.
Now, I get the error "Runtime error: 430/ class does not support automation
or does not support expected interface"

It fails on the copyfromrecordset method.

Here is the relevant code:
Dim objexcel As Excel.Application
Dim objwkb As Excel.Workbook
Dim objsht As Excel.Worksheet
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set objexcel = New Excel.Application
Set objwkb = objexcel.Workbooks.Open(strTemplateFileName)
objwkb.Sheets("Data").Visible = True

Set objsht = objwkb.Worksheets("Enrollment")
objsht.Select
With objsht
Set rs = db.OpenRecordset("001 Qry Pipeline Enrollment")
.Cells(2, 1).CopyFromRecordset rs '<----fails here!!!
.Cells(1, 1).Select
End With
rs.Close
Set rs = Nothing

Our company did a security push, but I'm not sure what exactly went out and
if it's the cause of this issue (seems like it would be) or just
coincidental. When I googled for an answer, they said it might be a
DAO360.dll issue, but I'm not using the version they say has a bug in it.

Any ideas?
Thanks!
-Mark
 
G

Guest

Hi David,

Thanks for the reply and I think you were the one who helped initially. I
tried without the parenthesis and it's still not working. As for why I have
differing versions of DAO, I noticed there were two different versions of
DAO360.dll on my computer, so I set the reference to one DLL file then the
other. Both times, I get the Error 430. So, I am only using one version at a
time.

Hope that clears things up. And thanks again for your help. Maybe I will try
again with the 8618 build.

-Mark
 
D

David Lloyd

Mark:

Since your code does not seem to be the issue now, this may be a dll version
issue. This error message can be caused, in some instances, by developing
code with one dll version and then deploying with a different dll version.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi David,

Thanks for the reply and I think you were the one who helped initially. I
tried without the parenthesis and it's still not working. As for why I have
differing versions of DAO, I noticed there were two different versions of
DAO360.dll on my computer, so I set the reference to one DLL file then the
other. Both times, I get the Error 430. So, I am only using one version at a
time.

Hope that clears things up. And thanks again for your help. Maybe I will try
again with the 8618 build.

-Mark
 
G

Guest

David,

THANK YOU!!!!!

Your fix worked perfectly, I'm not sure why it didn't work before (maybe I
forgot to restart the computer after changing the DLL?).

Anyway, I tried it today and it works just fine.

Thanks again for your help!!!!
 
G

Guest

I am having a similar problem with "Run-Time Error 430".

After installing Service Pack 2, the following code no longer works and
produces the error.

I also have 2 versions of DAO360.dll on my computer and have pointed to each
of them to no success.

If anyone has any recommendations for a fix or workaround for this problem
please advise.

Sorry for tagging on to your post, but for some reason I am unable to start
a new thread.

Option Compare Database

Private Sub Export_Picture_Click()

Dim frm As Access.Form
Dim fs As FileSystemObject
Dim strDest As String

strDest = "d:\data"
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FolderExists(strDest) = True Then
Set frm = Me.qry_Date_Ascending.Form
frm.ChartSpace.ExportPicture "d:\data\Error 430.jpg", , 800, 600
Else
Set frm = Me.qry_Date_Ascending.Form
frm.ChartSpace.ExportPicture "C:\temp\Error 430.jpg", , 800, 600
End If
End Sub
 
T

Tony Toews

Tom said:
I also have 2 versions of DAO360.dll on my computer and have pointed to each
of them to no success.

You shouldn't have two versions of DAO360.dll on your computer. What
folders are they in?
Option Compare Database

Add Option Explicit below the above line to ensure you are declaring
all variables. Amazing how typo's can sneak in.

On what line are you having the problem?
Set frm = Me.qry_Date_Ascending.Form

At first glance this doesn't look very proper.
frm.ChartSpace.ExportPicture "d:\data\Error 430.jpg", , 800, 600

And I've never seen the ChartSpace object before. Is that a control
of some type?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top