Within Access, I'm using the code shown below to create a link to a SQL Server table. My code works; but I need to make the linked table updatable.
If I create the link manually, Access prompts me to choose the "Unique Record Identifier" field(s); but I can't figure out how to provide this information from within my code.
Can anyone out there help me with this problem?
Thanks in Advance,
Jane
-----
strConnect = "ODBC;DRIVER={SQL Server}" _
& ";SERVER=" & strServer _
& ";DATABASE=" & strDB _
& ";UID=" & strUID _
& ";PWD=" & strPwd & ";"
Set strTblDef = db.CreateTableDef(strTblName)
strTblDef.SourceTableName = strTblName
strTblDef.Connect = strConnect
db.TableDefs.Append strTblDef
db.TableDefs.Refresh
If I create the link manually, Access prompts me to choose the "Unique Record Identifier" field(s); but I can't figure out how to provide this information from within my code.
Can anyone out there help me with this problem?
Thanks in Advance,
Jane
-----
strConnect = "ODBC;DRIVER={SQL Server}" _
& ";SERVER=" & strServer _
& ";DATABASE=" & strDB _
& ";UID=" & strUID _
& ";PWD=" & strPwd & ";"
Set strTblDef = db.CreateTableDef(strTblName)
strTblDef.SourceTableName = strTblName
strTblDef.Connect = strConnect
db.TableDefs.Append strTblDef
db.TableDefs.Refresh