Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unanswered: how to set dateformat command in Access 2007

    How are you guys??

    I've done a Class in Visual Basic 6.0 called MasterClass. With this class I can make Select, Insert, delete, update not only in MS access but Sql too.

    Now the problem is with Access 2007 when I'm trying to use the command "Set Dateformat" from the Class in VB. It's interesting that I've used this class with Ms access 2003, access 97, SQL 7, SQL server and Sql server 2005 and doesn't has any problem but when I try to use this class, especifycaly, "set dateformat" in MS access 2007 I get an error. The error is: "SQL instruction was not valid. It was expected: 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', UPDATE'".

    PLEASE somebody HELP ME. I need to complete the program that I'm doing.

    Thanks folks.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    As I know nothing about what you do in your class and how, it's almost impossible for me to figure out what's going on. Try to be more explicit and provide some information on the code being used.

    Have a nice day!

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    How can anyone help you if you don't post all the relevant code and details to do testing??
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Apr 2009
    Posts
    2
    Sorry guys.

    You can see the error doing the following:
    * Open MS Access 2007
    * Choose the option create/create Design View.
    * Then Rigth click and choose SQL VIEW and then write the commant: "SET DATEFORMAT dmy".

    Just doing that and you'll see the error


    thanks regards

  5. #5
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    SET DATEFORMAT does not seem to be a valid SQL command in Access. It does not work in 2007, but it does not work neither in 2003 nor in 2000.

    Have a nice day!

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Of course it doesn't, it's part of the MasterClass code that he won't share.

    Quote Originally Posted by himuramcat
    Sorry guys.

    You can see the error doing the following:
    * Open MS Access 2007
    * Choose the option create/create Design View.
    * Then Rigth click and choose SQL VIEW and then write the commant: "SET DATEFORMAT dmy".

    Just doing that and you'll see the error
    No, we won't.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Set Dateformat is however valid TSQL, it may be the class used a SQL server backend, and the OP isn't on his own machine
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    healdem,

    I agree with you and I know that SET DATEFORMAT is valid in TSQL but what is strange is that himuramcat posted that:
    It's interesting that I've used this class with Ms access 2003, access 97, SQL 7, SQL server and Sql server 2005 and doesn't has any problem
    Whatever he can do in his MasterClass class, I don't see how it can work in former versions of Access and not in 2007.

    If it works in ACC2003 and ACC97 his class must use some code to mimic the Set Dateformat command, knowing that this command is not valid in any version of Access.

    Have a nice day!

  9. #9
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I have a suspicion that when using the different versions of Access he may well be doing his studies connected to a SQL Server backend, when he gets home (and possibly using A 2007) and is using a JET back end, its JET not Access that throws a wobbler.
    I'd rather be riding on the Tiger 800 or the Norton

  10. #10
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're probably right, it must be something like that.

    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •