CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Help Hurry Help Please

    I am developing database application using CDAO classes and MS Access. I defined several querys using dates in the SQL WHERE clauses. All of my querys work fine on the development machine but when I tested on a client machine which only have Window 95 and the DAO dll installed, the application crashed. OH HELP HELP HELP.

    Sample query:
    PARAMETERS pvdtmStart DateTime;
    SELECT dtmVisitDate
    FROM Agenda
    WHERE dtmVisitDate >= pvdtmStart;

    Sample code accessing the query:


    CDaoQueryDef qdQuery(poDatabase)

    qdQuery.Open(strQuery);
    if(mpoParameter)
    for(int i = 0; i < mpoParameter->GetCount(); i++)
    {
    COleVariant * pvarParamValue = (COleVariant)
    mpoParameter->GetAt(mpoParameter->FindIndex(i));
    qdQuery.SetParamValue(i, pvarParamValue);
    }
    // This is where it crashes in the client machine
    mrsRecordset.Open(&qdQuery, dbOpenDynaset);
    ...
    }




    OH HELP HURRY
    I pin point the error because of the date in the WHERE clause, other query without a date in the WHERE clause works fine. Anyone have any suggestion on how I should solve this?

    Help please,
    Ted


  2. #2
    Join Date
    May 1999
    Location
    13 N 77 E
    Posts
    183

    Re: Help Hurry Help Please

    Maybe ..you are using a Locale dependent Date format ..
    you could find out from the settings control panel if these are different in the two machines
    good luck


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