Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with correcting code

Status
Not open for further replies.

AndieV

Technical User
Sep 2, 2001
10
0
0
CA
I'm having a problem with some code in the database that I am working on.

When I load this database on my computer it runs smoothly and without a hitch. When I load the same database on another computer, it doesn't run. Both computers are running ACCESS 2000. Am I missing something in the functions? Could someone give me a reason as to why it would work on one computer and not the other?

I really need help with this one.

Thanks,
Andie

Function changeTransFile(DbFile As String)

Dim dbs As Database, tdf As TableDef
' Return Database variable that points to current database.

Set dbs = CurrentDb
Set tdf = dbs.CreateTableDef("transition")

' Attach dbase III file
tdf.Connect = "dBASE III;DATABASE=C:\myfile"
tdf.SourceTableName = DbFile

' Debug.Print dbs.TableDefs("transition")

dbs.TableDefs.Append tdf

' save choice to db
' Debug.Print dbs

End Function

 
Check your references.. in the code window, click Tools and select references. Make sure the same ones are checked on both machines. Also, make sure they are in the same order. -Dustin
Rom 8:28
 
Thank you for your reply

The references are all the same and in the same order on both computers. If you have any other suggestions, they would be most appreciated.

Thanks
Andie
 
Hmm.. I'm not to familiar with linking to dbase III files.. you might need to make sure the other computer is set up for it. In your control panel there should be ODBC Data Sources. Make sure those settings are the same on both computers. -Dustin
Rom 8:28
 
" ...
tdf.Connect = "dBASE III;DATABASE=C:\myfile" ... "
refers to a file on the LOCAL machine. Does the file exist on BOTH?

Do you have te ODBC driver for dbIII on BOT machines?

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Hi MichaelRed

Thank you for the suggestion. Yes both computers are identical for file set up...I will be checking ODBC drivers, I hope that this does the trick.

Andie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top