467,879 Members | 1,117 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,879 developers. It's quick & easy.

How do I rename an Access database field via VB6?

Thanks for any help in advance!
Here 5 different cmdStrings that I have tried but they all have a syntax error in it that I cannot spot: (cmdString is dimmed as a String)

cmdString = "ALTER TABLE DealData CHANGE F&IManager FIManager VARCHAR(50)"

cmdString = "ALTER TABLE DealData CHANGE F&IManager FIManager"

cmdString = "ALTER TABLE DealData RENAME COLUMN F&IManager TO FIManager"

cmdString = "ALTER TABLE DealData RENAME COLUMN " & "'" & "F&IManager" & "'" & " TO " & "'" & "FIManager" & "'"

cmdString = "ALTER TABLE DealData CHANGE [F&IManager] FIManager VARCHAR(50)"

cmdString = "ALTER TABLE DealData RENAME COLUMN [F&IManager] TO FIManager"

Eric
Nov 15 '06 #1
  • viewed: 5320
Share:
1 Reply
100+
Thanks for any help in advance!
Here 5 different cmdStrings that I have tried but they all have a syntax error in it that I cannot spot: (cmdString is dimmed as a String)

cmdString = "ALTER TABLE DealData CHANGE F&IManager FIManager VARCHAR(50)"

cmdString = "ALTER TABLE DealData CHANGE F&IManager FIManager"

cmdString = "ALTER TABLE DealData RENAME COLUMN F&IManager TO FIManager"

cmdString = "ALTER TABLE DealData RENAME COLUMN " & "'" & "F&IManager" & "'" & " TO " & "'" & "FIManager" & "'"

cmdString = "ALTER TABLE DealData CHANGE [F&IManager] FIManager VARCHAR(50)"

cmdString = "ALTER TABLE DealData RENAME COLUMN [F&IManager] TO FIManager"

Eric
gi

this is very odd indeed, while i tried the cmdString stuff and have no syntax error.
by the way, i did not dim cmdString as String
sure your cmdString is no CommandButton ?
i would call my Button cmdString and the Caption strCommand ...
Nov 15 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Bill Stock | last post: by
3 posts views Thread by campbellbrian2001 | last post: by
2 posts views Thread by Gary T. | last post: by
1 post views Thread by solar | last post: by
3 posts views Thread by Iain King | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.