dbTalk Databases Forums  

Runtime error 3024 could not find file '0'

comp.database.ms-access comp.database.ms-access


Discuss Runtime error 3024 could not find file '0' in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Leah
 
Posts: n/a

Default Runtime error 3024 could not find file '0' - 08-04-2003 , 06:52 PM






Debugging code I didn't write and a novice to VB. The following code
is set up as a module within an Access Database:

Public Function FixProjNum()

Dim db As Database, tbl As TableDef, fld As Field


'Set up pointers (databse/table/field)
Set db = DBEngine.Workspaces(0).OpenDatabase(0)
Set tbl = db.TableDefs("testing")
Set fld = tbl("ChangeMe")

'Change ChangeMe to Integer data type
fld.Type = dbInteger

End Function

The above error is the error message I get when doing a "step into"
through the code in attempt to find the error. The "Runtime error
3024 could not find file '0'" appears after clicking step into after
the following line is highlighted yellow:

Set db = DBEngine.Workspaces(0).OpenDatabase(0)

Don't have any idea where to go with this, not sure where the
workspaces and opendatabase functions are, if this is what they are
etc....

Any help?

Reply With Quote
  #2  
Old   
tom
 
Posts: n/a

Default Re: Runtime error 3024 could not find file '0' - 08-08-2003 , 02:09 PM






in this case, Workspaces and OpenDatabase are not functions. they are
collections. handing a 0 to the Workspaces collection is supposed to
give you a default database, but that's probably not what you want.

if your data and this code are in the same .mdb, then you probably
want to reference the data in it. you can do this through the
CurrentDb object in DAO. changing the one line to:

Set db = Currentdb

will probably correct this error.

if your data is not in the same .mdb as this code, you will need to
reference the specific database that has the data. you can do that
with the Workspaces collection, if the database is not hidden.

hope this helps. tom

leahcronk (AT) juno (DOT) com (Leah) wrote in message news:<b78cf982.0308041552.75cf1134 (AT) posting (DOT) google.com>...
Quote:
Debugging code I didn't write and a novice to VB. The following code
is set up as a module within an Access Database:

Public Function FixProjNum()

Dim db As Database, tbl As TableDef, fld As Field


'Set up pointers (databse/table/field)
Set db = DBEngine.Workspaces(0).OpenDatabase(0)
Set tbl = db.TableDefs("testing")
Set fld = tbl("ChangeMe")

'Change ChangeMe to Integer data type
fld.Type = dbInteger

End Function

The above error is the error message I get when doing a "step into"
through the code in attempt to find the error. The "Runtime error
3024 could not find file '0'" appears after clicking step into after
the following line is highlighted yellow:

Set db = DBEngine.Workspaces(0).OpenDatabase(0)

Don't have any idea where to go with this, not sure where the
workspaces and opendatabase functions are, if this is what they are
etc....

Any help?

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.