-
Tornado - Date Format for MS SQL
Frank,
We're having difficulty figuring out how to format Dates using MS SQL. The errors occur during an 'Add or Update Record operation.
Here are the errors:
System.Data.OleDb.OleDbException: The name '#' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted. at System.Data.OleDb.OleDbDataReader.NextResults(IMul tipleResults imultipleResults, OleDbConnection connection, OleDbCommand command) at System.Data.OleDb.OleDbCommand.ExecuteReaderIntern al(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteNonQuery() at Tornado.Edit.Action_Edit_Execute_SQL(String sql, String which, Int32 recs)
(313 : 7) Error
Edit SQL = INSERT INTO mpoProject (mpoPin,mpoName,CreatedDate,OnStateSystem,WorkType ,County,mpoAgency) VALUES ('000611','Kingston/Ulster',#'1/22/04'#,'[[21]]','Bridge','Albany','City'
I have tried using:
.dbSQLDateFormat = "[M/d/yy H:mm:ss]" with no success. It appears that the # character is causing MS SQL to choke.
Any suggestions?
-
Paul,
Be sure to set .dbDBType="SQL".
-
-
In general, you should not be struggling with the date and other formats as ASP-db and Tornado will do the job for you. That is why the ASP-db code is fairly portable.
Frank
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|