Thanks for the input.
We have used the convert to string, then date approach. This bug has surfaced during an upgrade from AX3 to AX4. The AX3 code has been working for 4 years. Regards Steve From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Subbu Sent: Tuesday, 20 November 2007 11:09 PM To: Axapta-Knowledge-Village@yahoogroups.com Subject: [Axapta-Knowledge-Village] Re: AX 4.0 crashes when getting a date/time column from an ODBC data source for myDate = resultSet.getDate(1) ; // ERROR !!! do you know the 3rd column is daatetime type?? or you can use the CCADO* classes which are very powerful and very efficient... str getCRMContacts_INV(CustAccount _custAccount) { CCADOConnection Connection; CCADORecordSet adoRecordSet; str fslr1; str fslr2; str packQueryEmp; str packQueryContact; str emailPackQueryEmp; ; fslr1 = ''; fslr2 = ''; packQueryEmp = ''; packQueryContact = ''; emailPackQueryEmp = ''; Select FsemailConfigTable where FsemailConfigTable.RecId != 0; Connection = new CCADOConnection(); Connection.open(FsemailConfigTable.DBString); adoRecordSet = new CCADORecordSet(); adoRecordSet.open( strfmt("SELECT * FROM ACCOUNT where AccountNumber = '%1'",_custAccount),connection); while (!adoRecordSet.EOF()) { fslr1 = adoRecordSEt.fields().itemName("AccountId").value(); adoRecordSet.moveNext(); } adoRecordSet.close(); Connection.close(); if(fslr1 != '' ) { Connection = new CCADOConnection(); Connection.open(FsemailConfigTable.DBString); adoRecordSet = new CCADORecordSet(); if(curext() == '110') { adoRecordSet.open((strfmt(" SELECT * FROM CONTACT where ACCOUNTID = '%1' and invoicePBG = 1",fslr1)),connection); } else if( curext() == '210' ) { adoRecordSet.open((strfmt(" SELECT * FROM CONTACT where ACCOUNTID = '%1' and invoiceFFO = 1",fslr1)),connection); } while (!adoRecordSet.EOF()) { select FstmpEmailList; FstmpEmailList.ToEmail = adoRecordSEt.fields().itemName ("EMailAddress1").value(); FstmpEmailList.insert(); emailPackQueryEmp = emailPackQueryEmp+ adoRecordSEt.fields ().itemName("EMailAddress1").value(); emailPackQueryEmp = emailPackQueryEmp+';'; adoRecordSet.moveNext(); } adoRecordSet.close(); Connection.close(); } return emailPackQueryEmp; } --- In Axapta [EMAIL PROTECTED] <mailto:-Knowledge-Village%40yahoogroups.com> , "cdlmalherbe01" <[EMAIL PROTECTED]> wrote: > > Hi again, > > Instead of using the ODBCConnection and related classes, you could > use the CCADO* classes. > > --- In Axapta-Knowledge-Village@yahoogroups.com <mailto:Axapta-Knowledge-Village%40yahoogroups.com> , "Steve Wright" > <steve@> wrote: > > > > Hi > > > > The code below fails in AX3 3-tier and also in AX 4.0 (which can > only be 3-tier). > > > > myDate = resultSet.getDate(1) ; // AX CRASH!!! > > > > > > Does anyone know of a workaround? > > Thanks > > Steve > > > > > > > > > > OdbcConnection connection > > ; > > LoginProperty loginProperty = new LoginProperty() ; > > Statement statement > > ; > > ; > > loginProperty.setDSN("SQL2005Database") > > ; > > connection = new OdbcConnection(loginProperty) ; > > statement = connection.createStatement() > > ; > > resultSet = statement.executeQuery("select * from LedgerTrans") ; > > > > while (resultSet.next()) > > { > > myStr = resultSet.getString(1) ; // Ok > > myInt = resultSet.getInt(1) ; // Ok > > myDate = resultSet.getDate(1) ; // ERROR !!! > > } > > > > > > > > [Non-text portions of this message have been removed] > > > [Non-text portions of this message have been removed]