I needed to create a linked table with VBA. To do this I used the following code.
Set aTDef = myRPG.CreateTableDef(<NewLinkedTableName>)
aTDef.Connect = <Appropriate SQL Server connect string>
aTDef.SourceTableName = <New SQL Server View Name>
myRPG.TableDefs.Append aTDef
This works fine. But I got curious: I manually created a link to the same table using the External Data functionality on the ribbon. Then I enumerated the properties of the VBA-created link and compared them to those of the manually created link.
Mostly, they were the same. But the manually created link contains a unique index and the VBA-created link does not.
First, should this matter? Second, if so, how can I add an index from VBA? When I've tried to create/append an index, the operation is not allowed for linked tables.
Set aTDef = myRPG.CreateTableDef(<NewLinkedTableName>)
aTDef.Connect = <Appropriate SQL Server connect string>
aTDef.SourceTableName = <New SQL Server View Name>
myRPG.TableDefs.Append aTDef
This works fine. But I got curious: I manually created a link to the same table using the External Data functionality on the ribbon. Then I enumerated the properties of the VBA-created link and compared them to those of the manually created link.
Mostly, they were the same. But the manually created link contains a unique index and the VBA-created link does not.
First, should this matter? Second, if so, how can I add an index from VBA? When I've tried to create/append an index, the operation is not allowed for linked tables.