DoCmd.TransferDataBase command

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
 
T

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
 
A

AZB

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
 
A

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

DoCmd.TrasferDatabase adn ado indexing 0
ADO 0
Select Statement via DSN 1
DAO and Indexing 2
ODBC Connection 0
SQL-DAO-TextFiles 0
Too Many Indexes Bug 5
Tables Linked by ODBC - record locking issues. 1

Top