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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing table names 1

Status
Not open for further replies.

CTLReporting

Technical User
Jul 17, 2003
17
US
I am a Crystal report writer, and I imported a database into access because access is working easier than my current database right now, because of some software issues.

My problem:
When I import to access 2000, access adds a prefix to the table names. Where my table name is sample it would be informix_sample . Someone told me I can use code to change all 200 tables without going individually and renaming each table individually. Please help.



CTL Reports Group,
Running Crystal Reports 8.0 and 8.5
Bentonville, AR
FoodLabReports@ctlusa.net
 
Function ChangeName()

Dim AllTables As TableDef
Dim TableName As String

For Each AllTables In CurrentDb.TableDefs
TableName = AllTables.NAME
If Mid(TableName, 1, 9) <> &quot;Informix_&quot; Then
CurrentDb.TableDefs(TableName).NAME = Mid(TableName, 10, Len(TableName))
End If
Next AllTables

End Function
 
Sorry I copied the code.

Instead of <> replace it with =

If Mid(TableName, 1, 9) = &quot;Informix_&quot; Then
 
ok, thank you, I'm sure that works, but It errors out at

Code:
Dim AllTables As TableDef

it doesn't recognize tabledef

How do I get it to work?

CTL Reports Group,
Running Crystal Reports 8.0 and 8.5
Bentonville, AR
FoodLabReports@ctlusa.net
 
Nevermind, thank you very much, I added the library needed for it. Thanks!

CTL Reports Group,
Running Crystal Reports 8.0 and 8.5
Bentonville, AR
FoodLabReports@ctlusa.net
 
I&quot;m just having the same problem

how do I add that library.

I have had it in the past, but I forgot what to do.
 
in the module screen go to the tools menu, click on reference and make sure Microsoft DAO 3.6 Object Library is checked.

CTL Reports Group,
Running Crystal Reports 8.0 and 8.5
Bentonville, AR
FoodLabReports@ctlusa.net
 
Thanks!

I got it finally after breaking my head where I had to reference to the libraries.

Is there a description somewhere of what all these libraries can do?

 
Not that I know of. I read in a VB Programmers Reference about DAO libraries

CTL Reports Group,
Running Crystal Reports 8.0 and 8.5
Bentonville, AR
FoodLabReports@ctlusa.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top