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

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

Post by Farid Noujai » Sun, 14 Jun 1998 04:00:00



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

 
 
 

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

Post by Farid Noujai » Sun, 21 Jun 1998 04:00:00


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

 
 
 

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

Hi,

I have the following statement

          Set gDB = CreateDatabase(sDB, DB_LANG_GENERAL)

which VB 3 has no problems with. The executable on the other hand
gives a 3001 error, invalid argument.

FYI, sDB is properly declared and initialised.

Anyone would like to take a guess as to what the problem
might be?

George Vlahoulis

2. HP-UX 10.x recommendation? -Reply

3. OpenRecordset 3001 Invalid Argument error

4. any tech leads out there?

5. Error 3001 - Invalid argument

6. Table auditing

7. ERROR 3001 - "Invalid Argument"

8. LCK divide by zero problem HELP!!!

9. Error 3001: Invalid argument

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

11. CompactDatabase gives "3001: Invalid Argument"

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

13. Run-time error '3001'