Results 1 to 4 of 4

Thread: Tornado - Date Format for MS SQL

  1. #1
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115

    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?

  2. #2
    Join Date
    Oct 2002
    Posts
    32
    Paul,
    Be sure to set .dbDBType="SQL".

  3. #3
    Join Date
    Dec 2002
    Location
    Albany, NY
    Posts
    115
    That was it... Thanks...

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    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
  •