hi Ben,
> When I link to a SQL table from the Access File-->External Data etc it gives
> me a chance to designate the Primary Key. That allows the linked table to be
> updatable and insertable, without the key it is read only.
You may use the easier way:
CurrentDb.Execute "CREATE INDEX pk_" & ADestinationName & _
" ON " & ADestinationName & "(" & APrimaryKey & _
") WITH PRIMARY;"
http://groups.google.de/group/microsoft.public.access.modulesdaovba.ado/browse_t
hread/thread/174b742f91fb7ab1/6a40d6530a4c007f?lnk=st&q=access+oracle+execute+st
efan&rnum=4#6a40d6530a4c007f
mfG
--> stefan <--
Ben Silvert - 15 Mar 2007 14:33 GMT
Thanks Stefan. This worked. I used the CREATE INDEX statement and it added an
index:
Public Function testAddLinkIndex()
Dim Cn As New ADODB.Connection
Dim Cmd As New ADODB.Command
Dim strCommand As String
With Cn
.CursorLocation = adUseClient
.Provider = "Microsoft.Jet.OLEDB.4.0;"
.Open "Data Source=" & Application.CodeDb.Name & ";"
End With
With Cmd
strCommand = "CREATE INDEX pk_" & "1" & _
" ON " & "SQL_FINANCIAL_PROJECT_TRANSACTIONS" & "(" &
"Transaction_Type" & _
") WITH PRIMARY;"
.ActiveConnection = Cn
.CommandType = adCmdText
.CommandText = strCommand
.Execute
End With
End Function
> hi Ben,
>
[quoted text clipped - 11 lines]
> mfG
> --> stefan <--