473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

rename COLUMN navn i Access

Hi there !
I am trying to rename a column i Access
Set Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("\fpdb\currency.mdb")
sSQL = "ALTER TABLE DatoCurrency "
sSQL = sSQL & " COLUMN " & ucase(retcur) & " RENAME TO " &
UCASE(chkstring(request.form("cur"),"SQLString"))
conn1.execute sSQL
conn1.close

but I keep getting this error.
»»Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
statement.««

AnyOne know what I am doing wrong or have any idea on how to do this

Jul 21 '05 #1
3 4265
Response.Write sSQL
Response.End

What does your SQL command look like?

Ray at home

"TroelsM" <Tr*****@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
Hi there !
I am trying to rename a column i Access
Set Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("\fpdb\currency.mdb")
sSQL = "ALTER TABLE DatoCurrency "
sSQL = sSQL & " COLUMN " & ucase(retcur) & " RENAME TO " &
UCASE(chkstring(request.form("cur"),"SQLString"))
conn1.execute sSQL
conn1.close

but I keep getting this error.
»»Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
statement.««

AnyOne know what I am doing wrong or have any idea on how to do this

Jul 21 '05 #2
Hi Ray !
My SQL command looks like the one that I wrote
sSQL = "ALTER TABLE DatoCurrency "
sSQL = sSQL & " COLUMN " & ucase(retcur) & " RENAME TO " &
UCASE(chkstring(request.form("cur"),"SQLString"))
conn1.execute sSQL
conn1.close and this would ie on execute be like this
ALTER TABLE DatoCurrency COLUMN DKK RENAME TO DKP


"Ray Costanzo [MVP]" wrote:
Response.Write sSQL
Response.End

What does your SQL command look like?

Ray at home

"TroelsM" <Tr*****@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
Hi there !
I am trying to rename a column i Access
Set Conn1 = Server.CreateObject("ADODB.Connection")
Conn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("\fpdb\currency.mdb")
sSQL = "ALTER TABLE DatoCurrency "
sSQL = sSQL & " COLUMN " & ucase(retcur) & " RENAME TO " &
UCASE(chkstring(request.form("cur"),"SQLString"))
conn1.execute sSQL
conn1.close

but I keep getting this error.
»»Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
statement.««

AnyOne know what I am doing wrong or have any idea on how to do this


Jul 21 '05 #3
Okay, let me be a little more direct. Can you share it here?

Ray at home

"TroelsM" <Tr*****@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
Hi Ray !
My SQL command looks like the one that I wrote
sSQL = "ALTER TABLE DatoCurrency "
sSQL = sSQL & " COLUMN " & ucase(retcur) & " RENAME TO " &
UCASE(chkstring(request.form("cur"),"SQLString"))
conn1.execute sSQL
conn1.close

and this would ie on execute be like this
ALTER TABLE DatoCurrency COLUMN DKK RENAME TO DKP


"Ray Costanzo [MVP]" wrote:
Response.Write sSQL
Response.End

What does your SQL command look like?

Ray at home

"TroelsM" <Tr*****@discussions.microsoft.com> wrote in message
news:4B**********************************@microsof t.com...
> Hi there !
> I am trying to rename a column i Access
> Set Conn1 = Server.CreateObject("ADODB.Connection")
> Conn1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("\fpdb\currency.mdb")
> sSQL = "ALTER TABLE DatoCurrency "
> sSQL = sSQL & " COLUMN " & ucase(retcur) & " RENAME TO " &
> UCASE(chkstring(request.form("cur"),"SQLString"))
> conn1.execute sSQL
> conn1.close
>
> but I keep getting this error.
> »»Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE
> statement.««
>
> AnyOne know what I am doing wrong or have any idea on how to do this
>


Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul Casner | last post by:
I have a data warehouse that is about 10 terabyte's worth of data that must be loaded once a month. I am trying to use the DB2 version 8 rename table command but I discovered when you execute this...
0
by: Eric | last post by:
I need to rename a column in an Access Table. SQL RENAME doesn't seem to work. I found a message board from google that suggested RENAME doesn't work with Access at all. Any suggestions on how to...
0
by: juliane26 | last post by:
Even so it should not be there, it sometimes is: somebody wants to rename a column. Today we do unload / recreate table / load using our own db utilities to do so. Now we evaluate Object...
3
by: ineedahelp | last post by:
Hi, can anyone help me with the code necessary to rename a field in an access table. I have tried the ALTER TABLE method but it doesn't like my variable names. Here is the code and thank you for...
1
by: EricRogers | last post by:
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...
1
by: Carl Pearson | last post by:
Howdy, All, Was trying to modify all tables in a particular database starting with the same prefix, i.e., "tbl_". Decided I'd rather have them all start with "_tbl_" instead. Being lazy,...
2
by: mike_dba | last post by:
I am running V9 FP2 on DPF. I understand that V9 LUW now lets you rename a column. I can't seem to get the sytax right. Can anyone point me to what is wrong? db2 "ALTER TABLE myschema.mytable...
1
by: Gladiator | last post by:
Hi Team , Can some one tell me why we dont we have a DROP column or rename a column command in DB2 ? I Have a very Huge table and need to rename a column . The only option i have to do to rename...
4
by: ShadowLocke | last post by:
Hi, I have a table that has a column with name "comment" in it. I think that "comment" is an oracle keyword so i would like to rename this column. when i use the syntax "alter table tablename...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.