[Openroad-users] A little ADO help will be highly apreciated

Jonathan Barton Jonathan.Barton at uwe.ac.uk
Tue Mar 11 23:28:38 EST 2008


Yes you need to use MoveFirrst() before you loop through the records in the recordset and MoveNext() with the loop...
 
(eo_ado_rs = ADO!RecordSet)
 
If eo_ado_rs.EOF != True
 Then
  eo_ado_rs.MoveFirst();
   
  While eo_ado_rs.EOF = False
     Do  
      tbl[li_count].surname = eo_ado_rs.fields.item(0).value;
      tbl[li_count].dob = eo_ado_rs.fields.item(1).value;
   CurFrame.Trace(Text = 'Surname: ' + VarChar(tbl[li_count].surname) + ' DOB: ' + VarChar(tbl[li_count].dob));
      eo_ado_rs.MoveNext();
      li_count = li_count + 1;
     EndWhile;
 Endif;
 
HTH
 
Jonathan
 

________________________________

From: openroad-users-bounces at peerlessit.com [mailto:openroad-users-bounces at peerlessit.com] On Behalf Of Kim Ginnerup
Sent: 11 March 2008 11:55
To: International OpenROAD Users
Subject: [Openroad-users] A little ADO help will be highly apreciated



Hi all,

 

I need to take some date out of an SQL Server 2005 and put them into an Ingres database.

The existing system is experiencing severe performance problems so what else to do but moving it to Ingres. ;-)

 

I could use a little help on the code below.

Recordset.Recordcount() returns -1; no matter what I do

Recordset.state() returns 1

 

 

initialize()=

declare

            con = MSADO!connection default null;

            rec = MSADO!_recordset default null;

            err = MSADO!errors default null;

            sel = varchar(2000);

            res = varchar(2000);

            i = integer not null;

            cnt = integer not null;

            state = integer not null;

            connectString = varchar(2000) not null;

enddeclare

{

            curframe.trace('start');

            curframe.flush();

 

            con = MSADO!connection(MSADO!connection.new());

            rec = MSADO!_recordset(MSADO!_recordset.new());

 

            connectString = 

                        'Provider=sqloledb;' + 

                        'Network Library=DBMSSOCN;' +

                        'Data Source=172.16.2.40,1433;' +

                        'Initial Catalog=VIS_xxxx;' +

                        'User Id=sa;' +

                        'Password=xxxxxxx';

            con.open(connectString);

            // sel = 'SELECT TOP 10 kunde FROM dbo.KUND_Reklamation';

            sel = 'SELECT GETDATE()';

            rec = con.execute(sel,,);

 

            // message con.errors().item.description;

            cnt   = rec.recordcount();

            state = rec.state();

            curframe.trace(varchar(cnt) +' rows found. Recordset.state: ' + varchar(state));

 

            for i = 0 to cnt -1 do

                        res = rec.fields.item(i).value;

                        curframe.trace(varchar(i) +': ' + res);

            endfor;

 

            rec.close();

            con.close();

                        

            rec = NULL;

            con = NULL;

}

 

Venligst,/Regards,

 

Kim Ginnerup
Technical Manager 

Bording Data A/S
Bredskifte Allé 11
DK-8210  Århus V
________________________
Tlf.:             4324 5424
Direkte tlf.  4324 5370
Fax:            8624 8626 

Mail: kgi at bording.dk <mailto:kgi at bording.dk> 
web: http://www.bordingdata.dk/ <http://www.bordingdata.dk/> 

________________________________________________________________________

Til Deres information:
Med henblik på at dokumentere kommunikationen mellem Bording Data og kunder/partnere, foretages automatisk journalisering af ind- og udgående mails på firma/kontaktperson niveau.

For Your information:
In order to ensure documentation of communication between Bording Data and our customers/partners, in- and outgoing emails are journalized at company/contact level . 

 

________________________________

This incoming email to UWE has been independently scanned for viruses by McAfee anti-virus software and none were detected 



This email was independently scanned for viruses by McAfee anti-virus software and none were found
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080311/abf022cc/attachment.html 


More information about the Openroad-users mailing list