PDA

Visualizza la versione completa : [VB] Run-time error '424'


Fra
17-09-2002, 00:58
Ho un problema , un grosso problema. Spero mi possiate aiutare :

Ho fatto un programma. Quando lo avvio da Visual Basic ... NESSUN PROBLEMA. Quando invece creo l'eseguibile e lo avvio mi da in determinati punti dei msg di RUN-TIME ERROR '424' Object Required.
(ho provato a fare anche il pacchetto di istallazione .... ma non funzione cmq!).

Da cosa dipende ?

AIUTO, please!

darkblOOd
17-09-2002, 09:28
Knowledge Base Articles

PRJ4x: Run-Time Error 424 Using Data Access Object (DAO)Q169379


--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Project for Windows, versions 4.1, 4.1a

--------------------------------------------------------------------------------


SYMPTOMS
When you run a Visual Basic for Applications macro that uses a Data Access Object, you receive the following error message:



Run-time Error '424': Object Required



CAUSE
This problem occurs when either of the following is true:



The Data Access Object library is not properly referenced.

-or-


The Data Access Object files are missing, damaged, or improperly registered.


NOTE: This problem also occurs if you are running Windows NT 4.0, and the Microsoft Access Object Library is not referenced before the Data Access Object Library.



WORKAROUND
To resolve this problem, use the appropriate method.

Method 1: Data Access Object Library Not Registered
If the Data Access Object library is not properly referenced, follow these steps to create a reference to the library:


On the View menu, point to More Views.


In the More Views dialog box, click Module Editor, and then click Apply.


On the Tools menu, click References.


In the References dialog box, under Available References, click to select the "Microsoft DAO 3.0 Object Library" check box, and then click OK.

If the "Microsoft DAO 3.0 Object Library" option is not listed in the Available References list, click Browse and find the Dao3032.dll file. This file is located in the following folder:

Program Files\Common Files\Microsoft Shared\Dao

Click the file and then click OK.


In the References dialog box, click OK.


NOTE: If you are using Windows NT 4.0, you also need to create a reference to the Microsoft Access Object Library. To do this, use the preceding steps.

Also, if you reference the Microsoft Access Object Library, it must be referenced BEFORE the Microsoft Data Access Object Library.

If the Microsoft Data Access Object Library is referenced BEFORE the "Microsoft Access Object Library", do the following:


On the Tools menu, click References.


Click to clear the "Microsoft Data Access Object Library" check box and click OK.


On the Tools menu, click References.


Click to select the "Microsoft Data Access Object Library" check box.


Click OK.

This places the "Microsoft Data Access Object Library" reference after the "Microsoft Access Object Library" in the reference list.


Method 2: Missing, Damaged, or Unregistered Data Access Object Files
Microsoft provides examples of Visual Basic for Applications procedures for illustration only, without warranty either expressed or implied, including, but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support engineers can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426- 9400.

Before you replace the Data Access Object files, test the Data Access Object engine with a macro to ensure that it is working. To do this, type the following macro in a new module, and then run the macro:

Sub DAO_Test()
MsgBox DBEngine.Version
End Sub
If the macro returns an error message, and you already referenced the Data Access Object library, reinstall the Data Access Object engine by removing and then reinstalling it.

If you continue to receive the error message described in the "Symptoms" section of this article, continue use the following steps to troubleshoot this problem:


Open the file in Microsoft Project.


On the View menu, point to More Views.


In the More Views dialog box, click Module Editor, and then click Apply.


On the Tools menu, click References.


Clear any references to the Data Access Object libraries. Click OK.


On the File menu, click Save.


On the File menu, click Exit.


Restart Microsoft Project and open the file.

You can now reference the Data Access Object library you want to use.


If the problem continues after you follow the preceding steps, reinstall Microsoft Windows 95. For additional information, please see the following article in the Microsoft Knowledge Base:
Q142096 How to Reinstall Windows 95 to a New Folder

Additional query words:

Keywords : kbmacro
Issue type :
Technology :


Last Reviewed: November 3, 2000



--------------------------------------------------------------------------------

© 1987-2001 Microsoft Corporation. All rights reserved.

darkblOOd
17-09-2002, 09:29
quest'articolo edlla KB si riferisce alle macro VB. Se tu stai usando l'oggetto DAO, cmq potrebbe essere un punto di partenza per vedere se crea lo stesso problema anche in vb.

biifu
17-09-2002, 09:57
424 può anche essere la mancanza di un ocx
se tu crei l'exe e lo fai girare sulla postazione si sviluppo te lo da lo stesso?

elfocaotico
25-09-2002, 11:35
Up:gren:

Fra
30-09-2002, 16:13
Il mio problema era che spesso non usavo "Call" quando richiamavo delle routine con un parametro. Infatti VB non lo segnala come errore (Call risulta obbligatorio per le routine con 2 o più parametri), ma in fase di creazione dell'eseguibile da un errore in run-time.

Forse è anche il caso tuo?

elfocaotico
30-09-2002, 17:33
Grazie a tutti.

Ho installato nuovamente Vb e non me lo dà +. Vai a sapere..:gren:

Loading