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

How do I rename an Access database field via VB6?

P: 1
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
Share this Question
Share on Google+
1 Reply


100+
P: 267
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.