f



access2007 create table error - invalid argument

I've got a 2nd MDB with a table (tblPersonalInfo) and I'm trying to
create a linked table
strsql is the path to that mdb

this works
        Set db = CurrentDb
        Set tbl = db.CreateTableDef("tblPersonalInfo." & lngEmpCode, _
                                    dbHiddenObject, _
                                    "tblPersonalInfo", _
                                    strSql)

but if I use, dbAttachedODBC, I get an error, invalid argument

yet if I use the link table manager to link to the table and I display
its attribute property it is set to the value of dbAttachedODBC, and
the sourceName and connect value match what I'm using above

what am I missing ?
0
Roger
12/13/2010 3:13:05 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

2 Replies
675 Views

Similar Articles

[PageSpeed] 15

On Dec 13, 8:13=A0am, Roger <lesperan...@natpro.com> wrote:
> I've got a 2nd MDB with a table (tblPersonalInfo) and I'm trying to
> create a linked table
> strsql is the path to that mdb
>
> this works
> =A0 =A0 =A0 =A0 Set db =3D CurrentDb
> =A0 =A0 =A0 =A0 Set tbl =3D db.CreateTableDef("tblPersonalInfo." & lngEmp=
Code, _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 d=
bHiddenObject, _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "=
tblPersonalInfo", _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 s=
trSql)
>
> but if I use, dbAttachedODBC, I get an error, invalid argument
>
> yet if I use the link table manager to link to the table and I display
> its attribute property it is set to the value of dbAttachedODBC, and
> the sourceName and connect value match what I'm using above
>
> what am I missing ?

it looks like 'dbAttachedODBC' is readonly
using dbAttachSavePWD sets up the linked table properly
0
Roger
12/13/2010 5:10:51 PM
I just use CREATE TABLE syntax, because I think that's a lot easier to deal with.

Aren't you tired of dealing with all this extra bullshit involved with linked tables? 
0
aaron.kempf (199)
1/3/2011 12:02:47 PM
Reply: