By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

Creating and Modifying tables in a remote database

P: n/a
RWC
Hello,

I'm trying to do some updates on the fly in a remote database. I'd like to
do this with code. I'm running basically the following code;

Dim db As Database
Dim tblDefs As TableDefs
Dim tblDef As TableDef
Dim strCurrentDatabase As String

strCurrentDatabase = GetDatabase("desktop", "Find Database") 'Get Database
opens dialog box to locate the database

Set db = OpenDatabase(strCurrentDatabase)

For Each tblDef In db.TableDefs

DoCmd.Rename "TMP" & tblDef.Name, acTable, tblDef.Name

Next tblDef

This doesn't seem to work though, it's trying to rename the local link name,
if a link exists of the same name. Outside of just renaming a table out of
the way, I'd like to be able to add fields or modify field properties. Any
help would be appreciated. I'm using Access XP with SP2 installed on a
Windows XP pro machine.

If you reply to this posting via email, please remove the caps and
underscores.

Thanks in advance!
Rick
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
RWC wrote:
Hello,

I'm trying to do some updates on the fly in a remote database. I'd like to
do this with code. I'm running basically the following code;

Dim db As Database
Dim tblDefs As TableDefs
Dim tblDef As TableDef
Dim strCurrentDatabase As String

strCurrentDatabase = GetDatabase("desktop", "Find Database") 'Get Database
opens dialog box to locate the database

Set db = OpenDatabase(strCurrentDatabase)

For Each tblDef In db.TableDefs

DoCmd.Rename "TMP" & tblDef.Name, acTable, tblDef.Name

Next tblDef


Check out Marshall Barton's answer in this post here:

(Note: this is going to wrap so you'll need to copy/paste to get a single line:)
http://groups.google.com/groups?hl=e...ases.ms-access

--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #2

P: n/a
RWC
Thanks John, that has me headed in the right direction for sure.
"John Mishefske" <mi****@execpc.com> wrote in message
news:10*************@corp.supernews.com...
RWC wrote:
Hello,

I'm trying to do some updates on the fly in a remote database. I'd like to do this with code. I'm running basically the following code;

Dim db As Database
Dim tblDefs As TableDefs
Dim tblDef As TableDef
Dim strCurrentDatabase As String

strCurrentDatabase = GetDatabase("desktop", "Find Database") 'Get Database opens dialog box to locate the database

Set db = OpenDatabase(strCurrentDatabase)

For Each tblDef In db.TableDefs

DoCmd.Rename "TMP" & tblDef.Name, acTable, tblDef.Name

Next tblDef
Check out Marshall Barton's answer in this post here:

(Note: this is going to wrap so you'll need to copy/paste to get a single

line:) http://groups.google.com/groups?hl=e...ases.ms-access
--
'-------------------------------
' John Mishefske
'-------------------------------

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.