DoCmd.TransferDataBase command

  • Thread starter Thread starter taccea
  • Start date Start date
T

taccea

Hello,

I have imported via ODBC 3 tables into Access2000 from SQL2000.

When I try to index on of the tables using ADO it erros out, acting like if
after the import the table remaind open.
If I make a copy of the table then run the same indexing code it works on
the copy, but not on the original table
brought in by the ODBC,
How do I allow for writing to this table after the import?

taccea
 
Thanks,

I did not link but acimport.

Here is the sample code:::
DoCmd.TransferDatabase acImport, "ODBC Database", _
"ODBC;DSN=GHT;UID=SA;PWD=;LANGUAGE=us_english;" _
& "DATABASE=GHT", acTable, "check_detail", "ghtCheckDetail"

Here is when it fails:
Dim dbsPBFirst As Database
Set dbsPBFirst = CurrentDb
Dim tdfGHTcheckDetail As TableDef
Set tdfGHTcheckDetail = dbsPBFirst!ghtCheckDetail
Dim idxBonusID As Index

With tdfGHTcheckDetail
Set idxBonusID = .CreateIndex("BonusIDIndex")
With idxBonusID
.Fields.Append .CreateField("bonus_id")
End With
.Indexes.Append idxBonusID ''''!!!!!! ERROS OUT RIGHT HERE
!!!!!!!!!!!!
.Indexes.Refresh
End With

Thanks

Taccea
 
It seems to me that insted of importing you've linked the tables. That's why
you cannot modify the structure in this case the indexes.-

Try deleting and importing again.-

Good Luck

AZb
 
Taccea: Well, i was worng, haven't you perhaps declared in referens first
ADO insted of DAO. Remember that DAO must be first than ADO because Access
use DAO for handing selfs information.-

An other reason could be that perhaps the transfer method works analogically
and is still in duty when you call de indexing function.-


Good luck,

AZB
 
Back
Top