CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 1999
    Posts
    5

    Date thru DataEnvironment

    I'm using dataenvironment for inserting records in my program(Backend is Access). while inserting date(I'm using 'insert into ..' statement), it stores it's won format.
    for example,
    "Insert into table1(Name, CrDate) values("VB", Date)"
    The date is 28th Sep 2001. But it stores some other format, like 09 Jan 2028 and 01 sep 2028.

    I tried this with anoher program with recordset(not thru dataenvironment) like
    dim DB as Databases
    dim wrkspc as workspaces
    dim rsTemp as recordset
    set db=DBEngine....Opendatabase("test.mdb")
    set rsTemp=DB.Openrecordset("Table1", dbOpenDynaset)
    rsTemp.AddNew
    rsTemp.Fields("Name")="VB"
    rsTemp.Fields("CrDate")=Date
    rsTemp.Update

    It stores the date correctly.
    I don't know what is the problem.
    Pls help me for the above.



  2. #2
    Join Date
    Jan 2001
    Posts
    365

    Re: Date thru DataEnvironment

    Hi Friend

    Insert into table1(Name, CrDate) values("VB", Date)"

    i think U defeined ur temp variable crdate as string or some other. better to define Crdate as date. otherwise use formatedate(crdate,"mm/dd/yyyy").. some thing like

    Thanks

    Bala
    Prelude Solution Providers (P) Ltd.
    Chennai.India

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured