On Wed, 2 Nov 2005 11:39:47 +0100, Philipp Stiefel <phil[ at ]codekabinett.de> wrote:
[Quoted Text] >Peter L Reader <preader[ at ]spammenot.pacifier.com> wrote: > >> I'm trying to link to an Adaptive Server Anywhere 9.0 db in Access 2K >> code: >> >> Dim ConnectString As String, MyDB As DAO.Database, MyTDF As >> DAO.TableDef >> Dim LocalName As String, ForeignName As String >> ConnectString = "Connect=ODBC;Database=GIDS;DSN=GIDSHome;" >> LocalName = "dbo_TktRemarks" >> ForeignName = "dbo.TktRemarks" >> Set MyDB = CurrentDb >> Set MyTDF = MyDB.CreateTableDef(LocalName, ForeignName, ConnectString) >> MyDB.TableDefs.Append MyTDF >> >> >> When I run this, I get a run-time error 3421, "Data type conversion >> error" on the Set MyTDF statement. > >The order of arguments for CreateTableDef is: > >CreateTableDef (name, attributes, source, connect) > >You're passing "ForeignName" instead of the "attributes"-argument, >which is a Long. That causes the datatype conversion error. > >HTH >Phil
Oh!! I thought since the argument was optional, I could ignore it. But I probably should have used a placeholder...I'll try this right away. Thanks!
|