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

rename COLUMN navn i Access

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.