Please Help...Linking MBD's with code -- ERROR 3001 - Invalid Argument 
Author Message
 Please Help...Linking MBD's with code -- ERROR 3001 - Invalid Argument

Hello,

    Here is my problem.  I'm trying to link two tables from one mdb to
another.  I found this code posted everywhere (books, net...I think even the
bathroom wall had it).  Anyway...all is fine up until you hit the last line.

The tabledef is created then the connection is made (path and database are
correct).  I set the sourcetablename (which is also correct) BUT once I hit
MainDB.TableDefs.Append NewLinkedTDF  -- POOF!!!  Error 3001 - Invalid
Argument.  I've looked at this code for a few hours trying different ways to
do things, to no avail.   If you've run into this problem please help.

As a note....MainDB is already opened (Sub Main) and the LinkFromDBName mdb
does exist where the path states.

    Set NewLinkedTDF = MainDB.CreateTableDef(tbl)
    NewLinkedTDF.Connect = "; DATABASE = " & DBPath & "\" & LinkFromDBName
    NewLinkedTDF.SourceTableName = tbl
    MainDB.TableDefs.append NewLinkedTDF

Any help is greatly appreciated

Sincerely,

Farid



Wed, 29 Nov 2000 03:00:00 GMT
 Please Help...Linking MBD's with code -- ERROR 3001 - Invalid Argument

In case anyone wants to know I figured out the problem.  In this line:

NewLinkedTDF.Connect = "; DATABASE = " & DBPath & "\" & LinkFromDBName

the connect string is such -->   ;DATABASE = C:\APPDIR\APP.MDB

THE PROBLEM IS THE = sign....  it was preceeded and succeeded by spaces.  I
removed the spaces and voila...linking heaven.

This is just for your info......

Farid



Wed, 06 Dec 2000 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Error 3001, Invalid Argument, Not all the time!

2. OpenRecordset 3001 Invalid Argument error

3. Error 3001 - Invalid argument

4. ERROR 3001 - "Invalid Argument"

5. Error 3001: Invalid argument

6. Please help: Run-time error '3001'

7. CompactDatabase gives "3001: Invalid Argument"

8. Error 3001 - Arguments are of the wrong type...

9. Run-time error '3001'

10. Runtime error '3001'

11. Runtime error '3001'

12. Runtime error '3001'


 
Powered by phpBB® Forum Software