rename COLUMN navn i Access

T

TroelsM

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
 
R

Ray Costanzo [MVP]

Response.Write sSQL
Response.End

What does your SQL command look like?

Ray at home
 
T

TroelsM

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 said:
Response.Write sSQL
Response.End

What does your SQL command look like?

Ray at home

TroelsM said:
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
 
R

Ray Costanzo [MVP]

Okay, let me be a little more direct. Can you share it here?

Ray at home

TroelsM said:
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 said:
Response.Write sSQL
Response.End

What does your SQL command look like?

Ray at home

TroelsM said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top