Guest_imported
New member
- Jan 1, 1970
- 0
I'd like to know how to rename a field. My code below doesn't work at all.
Set objRS=Server.CreateObject("ADODB.Recordset"
strQuery="ALTER TABLE " &TableName & " RENAME " & FieldName & " TO " & FieldNewName
objRS.Open strQuery, objConn
I have the error:
Microsoft JET Database Engine error '80040e14'
Syntax error in ALTER TABLE statement.
We told me on a forum to try DAO as ADO doesn't support ALTER TABLE:
Dim dbs As Database
Set dbs = OpenDatabase(database)
dbs.Execute "ALTER TABLE " & tablename & " RENAME COLUMN " & Title & " to " & newTitle
dbs.Close
But it doesn't work, I have this error:
Expected end of statement
/db/dev/SaveChangeSpec.asp, line 51
Dim dbs As Database
--------^
Maybe I must think about another connection?
Set objRS=Server.CreateObject("ADODB.Recordset"
strQuery="ALTER TABLE " &TableName & " RENAME " & FieldName & " TO " & FieldNewName
objRS.Open strQuery, objConn
I have the error:
Microsoft JET Database Engine error '80040e14'
Syntax error in ALTER TABLE statement.
We told me on a forum to try DAO as ADO doesn't support ALTER TABLE:
Dim dbs As Database
Set dbs = OpenDatabase(database)
dbs.Execute "ALTER TABLE " & tablename & " RENAME COLUMN " & Title & " to " & newTitle
dbs.Close
But it doesn't work, I have this error:
Expected end of statement
/db/dev/SaveChangeSpec.asp, line 51
Dim dbs As Database
--------^
Maybe I must think about another connection?