Data-Control (Error 438) 
Author Message
 Data-Control (Error 438)

Hi

In my code I do the following, when the form will be opened:

  On Error Resume Next
  DBEngine.SystemDB = "D:\DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdw"
  Set mwrkZurich = DBEngine.CreateWorkspace("Zurich", "User", "test")
  Set mdbsZurich =
mwrkZurich.OpenDatabase("D:DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdb")
  Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")
  Set Data1.Recordset = mrstTest
  If Err.Number > 0 Then
    Resume
  End If
  txtGUID.DataField = "GUID"

I get the error 438 when the line [Set Data1.Recordset=mrstTest] should be
executed, that the object doesn't support this method or property. But the
form will be opened and the controls are connected to the database anyway.
If I delete this assignment, no error occurs and the controls are not
connected. Can somebody explain why I get this error and why I can not catch
the error?

I use VB 5.0 with SP3.

Thanks
Oli



Wed, 28 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
This is a long shot (it's been awhile since I've dealt with DAO) but I
believe that the "Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM
tblCreator")" line returns a forwardonly snapshot because you didn't specify
what you wanted.  The data control might have a problem with the forward
only part.  Specify you want a recordset that supports all the .Movexxxx
methods.

--

Later,
Tony Fountain, MCP
===================================================
Please do not email me directly, my wife already clutters up my inbox
===================================================

Quote:
> Hi

> In my code I do the following, when the form will be opened:

>   On Error Resume Next
>   DBEngine.SystemDB = "D:\DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdw"
>   Set mwrkZurich = DBEngine.CreateWorkspace("Zurich", "User", "test")
>   Set mdbsZurich =
> mwrkZurich.OpenDatabase("D:DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdb")
>   Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")
>   Set Data1.Recordset = mrstTest
>   If Err.Number > 0 Then
>     Resume
>   End If
>   txtGUID.DataField = "GUID"

> I get the error 438 when the line [Set Data1.Recordset=mrstTest] should be
> executed, that the object doesn't support this method or property. But the
> form will be opened and the controls are connected to the database anyway.
> If I delete this assignment, no error occurs and the controls are not
> connected. Can somebody explain why I get this error and why I can not
catch
> the error?

> I use VB 5.0 with SP3.

> Thanks
> Oli



Wed, 28 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
Hi

It also doesn't work, if I set Data1.RecordSetType=vbRSTypeDynaset before.
An additional information, the error occurs only the first time. If I assign
my RecordSet again, I didn't get the error.

Oli

Tony Fountain schrieb in Nachricht ...

Quote:
>This is a long shot (it's been awhile since I've dealt with DAO) but I
>believe that the "Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM
>tblCreator")" line returns a forwardonly snapshot because you didn't
specify
>what you wanted.  The data control might have a problem with the forward
>only part.  Specify you want a recordset that supports all the .Movexxxx
>methods.

>--

>Later,
>Tony Fountain, MCP
>===================================================
>Please do not email me directly, my wife already clutters up my inbox
>===================================================


>> Hi

>> In my code I do the following, when the form will be opened:

>>   On Error Resume Next
>>   DBEngine.SystemDB = "D:\DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdw"
>>   Set mwrkZurich = DBEngine.CreateWorkspace("Zurich", "User", "test")
>>   Set mdbsZurich =
>> mwrkZurich.OpenDatabase("D:DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdb")
>>   Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")
>>   Set Data1.Recordset = mrstTest
>>   If Err.Number > 0 Then
>>     Resume
>>   End If
>>   txtGUID.DataField = "GUID"

>> I get the error 438 when the line [Set Data1.Recordset=mrstTest] should
be
>> executed, that the object doesn't support this method or property. But
the
>> form will be opened and the controls are connected to the database
anyway.
>> If I delete this assignment, no error occurs and the controls are not
>> connected. Can somebody explain why I get this error and why I can not
>catch
>> the error?

>> I use VB 5.0 with SP3.

>> Thanks
>> Oli



Wed, 28 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
No, I meant the type of recordset that you create with your recordset
variable, not the data control.

Change:

Quote:
>Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")

to:
Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator",
dbOpenSnapshot)

--

Later,
Tony Fountain, MCP
===================================================
Please do not email me directly, my wife already clutters up my inbox
===================================================

Quote:
> Hi

> It also doesn't work, if I set Data1.RecordSetType=vbRSTypeDynaset before.
> An additional information, the error occurs only the first time. If I
assign
> my RecordSet again, I didn't get the error.

> Oli

> Tony Fountain schrieb in Nachricht ...
> >This is a long shot (it's been awhile since I've dealt with DAO) but I
> >believe that the "Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM
> >tblCreator")" line returns a forwardonly snapshot because you didn't
> specify
> >what you wanted.  The data control might have a problem with the forward
> >only part.  Specify you want a recordset that supports all the .Movexxxx
> >methods.

> >--

> >Later,
> >Tony Fountain, MCP
> >===================================================
> >Please do not email me directly, my wife already clutters up my inbox
> >===================================================


> >> Hi

> >> In my code I do the following, when the form will be opened:

> >>   On Error Resume Next
> >>   DBEngine.SystemDB = "D:\DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdw"
> >>   Set mwrkZurich = DBEngine.CreateWorkspace("Zurich", "User", "test")
> >>   Set mdbsZurich =
> >> mwrkZurich.OpenDatabase("D:DAT\OFFICE\MACROS\ZIBtest\ZIB_Word97.mdb")
> >>   Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")
> >>   Set Data1.Recordset = mrstTest
> >>   If Err.Number > 0 Then
> >>     Resume
> >>   End If
> >>   txtGUID.DataField = "GUID"

> >> I get the error 438 when the line [Set Data1.Recordset=mrstTest] should
> be
> >> executed, that the object doesn't support this method or property. But
> the
> >> form will be opened and the controls are connected to the database
> anyway.
> >> If I delete this assignment, no error occurs and the controls are not
> >> connected. Can somebody explain why I get this error and why I can not
> >catch
> >> the error?

> >> I use VB 5.0 with SP3.

> >> Thanks
> >> Oli



Wed, 28 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
Hi

I tried it, but it still doesn't work. I always get the same error that I
can't catch.
I think it is importent to say it again, that either I get this error, after
confirming this error, the connection works fine.

Oli

Tony Fountain schrieb in Nachricht ...

Quote:
>No, I meant the type of recordset that you create with your recordset
>variable, not the data control.

>Change:
>>Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")

>to:
>Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator",
>dbOpenSnapshot)



Thu, 29 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
Well, I just tried the code (with a different database) and it all works
fine.  But there are a few things that leave me curious about your code: (1)
the On Error Resume Next.  This might be why you can't catch the error.  And
(2) The Resume statement.  There is no way this will work.  It needs to be
in a error handler for it to do anything.  In this current usage you'll get
an error "Resume without error" (or something like that).  Also, how do you
have your DAO objects declared?  What DAO library are you using (under
Project | References)?

--

Later,
Tony Fountain, MCP
===================================================
Please do not email me directly, my wife already clutters up my inbox
===================================================

Quote:
> Hi

> I tried it, but it still doesn't work. I always get the same error that I
> can't catch.
> I think it is importent to say it again, that either I get this error,
after
> confirming this error, the connection works fine.

> Oli

> Tony Fountain schrieb in Nachricht ...
> >No, I meant the type of recordset that you create with your recordset
> >variable, not the data control.

> >Change:
> >>Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")

> >to:
> >Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator",
> >dbOpenSnapshot)



Thu, 29 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
Hi

I use DAO 3.51.

If you want to catch an error just in a critical line you can do this with
On Error Resume Next. If an error occurs, the next line that will be
executed is the check [If Err.Number > 0 Then] and I can handle the error
just after the critical line.

Oli

Tony Fountain schrieb in Nachricht ...

Quote:
>Well, I just tried the code (with a different database) and it all works
>fine.  But there are a few things that leave me curious about your code:
(1)
>the On Error Resume Next.  This might be why you can't catch the error.
And
>(2) The Resume statement.  There is no way this will work.  It needs to be
>in a error handler for it to do anything.  In this current usage you'll get
>an error "Resume without error" (or something like that).  Also, how do you
>have your DAO objects declared?  What DAO library are you using (under
>Project | References)?

>--

>Later,
>Tony Fountain, MCP
>===================================================
>Please do not email me directly, my wife already clutters up my inbox
>===================================================


>> Hi

>> I tried it, but it still doesn't work. I always get the same error that I
>> can't catch.
>> I think it is importent to say it again, that either I get this error,
>after
>> confirming this error, the connection works fine.

>> Oli

>> Tony Fountain schrieb in Nachricht ...
>> >No, I meant the type of recordset that you create with your recordset
>> >variable, not the data control.

>> >Change:
>> >>Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")

>> >to:
>> >Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator",
>> >dbOpenSnapshot)



Fri, 30 Nov 2001 03:00:00 GMT  
 Data-Control (Error 438)
Quote:
> I use DAO 3.51.

Hmm, I don't know what else to suggest then.  Sorry.  I tried this code and
it works just fine for me, with the exception of the Resume statement.  I
understand the concept of you using On Error Resume Next.  Heck, I even us
it myself on occasion.  But the Resume?  First, I see why you're attempting
to use it, in theory.  But why do you need it if you have an On Error Resume
Next?  If there was an error it will continue anyway.  Second, even if you
did need that there it won't work.  Try it.  Just before the "If Err.Number
= 0 Then" do a Err.Raise 32767,,"Test Error" and see what happens.  It will
hit your Resume statement and return another error.  Something like "Resume
without error.", which will get bypassed because of the On Error Resume Next
statement.

--

Later,
Tony Fountain, MCP
===================================================
Please do not email me directly, my wife already clutters up my inbox
===================================================

Quote:

> If you want to catch an error just in a critical line you can do this with
> On Error Resume Next. If an error occurs, the next line that will be
> executed is the check [If Err.Number > 0 Then] and I can handle the error
> just after the critical line.

> Oli

> Tony Fountain schrieb in Nachricht ...
> >Well, I just tried the code (with a different database) and it all works
> >fine.  But there are a few things that leave me curious about your code:
> (1)
> >the On Error Resume Next.  This might be why you can't catch the error.
> And
> >(2) The Resume statement.  There is no way this will work.  It needs to
be
> >in a error handler for it to do anything.  In this current usage you'll
get
> >an error "Resume without error" (or something like that).  Also, how do
you
> >have your DAO objects declared?  What DAO library are you using (under
> >Project | References)?

> >--

> >Later,
> >Tony Fountain, MCP
> >===================================================
> >Please do not email me directly, my wife already clutters up my inbox
> >===================================================


> >> Hi

> >> I tried it, but it still doesn't work. I always get the same error that
I
> >> can't catch.
> >> I think it is importent to say it again, that either I get this error,
> >after
> >> confirming this error, the connection works fine.

> >> Oli

> >> Tony Fountain schrieb in Nachricht ...
> >> >No, I meant the type of recordset that you create with your recordset
> >> >variable, not the data control.

> >> >Change:
> >> >>Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator")

> >> >to:
> >> >Set mrstTest = mdbsZurich.OpenRecordset("SELECT * FROM tblCreator",
> >> >dbOpenSnapshot)



Fri, 30 Nov 2001 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Error 438 and Sheridan Data Grids

2. RT Error 438 Pasting VB Control into Interdev

3. WebBrowser Control - Error 438

4. Runtime Error 438 when using VS2005 C++ATL control with VB6 form

5. Run-Time Error '438'

6. Need help with error 438!!!

7. wordbasic statement "AppMaximize" generates error 438

8. Run time error 438

9. run time error 438

10. Runtime error 438

11. Runtime Error 438 - What does this mean?

12. error #438: tabstrip problem?

 

 
Powered by phpBB® Forum Software