I do create a new table and make a link to it with odbc , but the table is not updatable, i can only insert records, not delete or update
Function qqqq()
Dim A As Database
Dim b As QueryDef
Dim C As DAO.Recordset
Dim d As TableDef
On Error GoTo ERR_1
DoCmd.SetWarnings False
Set A = CurrentDb()
Set b = A.CreateQueryDef("qrytemp")
b.connect = "odbc;DSN=aaaaa;DATABASE=aaaaa;"
b.SQL = "CREATE TABLE newtable " & _
" (qa CHAR(6) ," & _
" qb CHAR(2) ," & _
" qc CHAR(8) )"
b.ReturnsRecords = True
Set C = b.OpenRecordset()
ERR_1:
Resume Next
CurrentDb.QueryDefs.delete "qryTemp"
Set d = A.CreateTableDef("newlink")
d.connect = "odbc;DSN=aaaaa;DATABASE=aaaaa;"
d.SourceTableName = "newtable"
A.TableDefs.Append d
Set C = A.OpenRecordset("newtable")
End Function
Function qqqq()
Dim A As Database
Dim b As QueryDef
Dim C As DAO.Recordset
Dim d As TableDef
On Error GoTo ERR_1
DoCmd.SetWarnings False
Set A = CurrentDb()
Set b = A.CreateQueryDef("qrytemp")
b.connect = "odbc;DSN=aaaaa;DATABASE=aaaaa;"
b.SQL = "CREATE TABLE newtable " & _
" (qa CHAR(6) ," & _
" qb CHAR(2) ," & _
" qc CHAR(8) )"
b.ReturnsRecords = True
Set C = b.OpenRecordset()
ERR_1:
Resume Next
CurrentDb.QueryDefs.delete "qryTemp"
Set d = A.CreateTableDef("newlink")
d.connect = "odbc;DSN=aaaaa;DATABASE=aaaaa;"
d.SourceTableName = "newtable"
A.TableDefs.Append d
Set C = A.OpenRecordset("newtable")
End Function