The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Object has EOF property - how do I access it?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jguenrdc Posted - 05/30/2006 : 6:02:00 PM
Origin Version: OriginPro 7.5 SR6 v7.5885(B885)
Operating System: Windows XP Pro SP2

I want to use the EOF property of an ADO Recordset object. For example (note I have remove some code and details, so it won't compile as-is):

static Object ocrs;
/* other code */
BOOL b1,b2; // return value from various functions
ocrs = CreateObject("ADODB.Recordset"); // create recordset object
if( !ocrs ) // if not created
return FALSE; // exit
strConn = "Provider=SQLOLEDB; <...other stuff...>"; // connection string
strQuery = "SELECT <...other stuff...>"; // T-SQL statement
ocrs.CursorLocation = 3; // use client-side cursor
ocrs.open( strQuery, strConn, 1, 3); // open recordset
b1 = ocrs.BOF;
b2 = ocrs.EOF;

The line with the EOF gives this error:
Error, '': illegal name for identifier or type

I'm guessing this is because EOF is a constant in Origin C. How can I access this property of the ADO object?

Jay

Edited by - jguenrdc on 05/31/2006 10:38:45 AM
1   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 06/01/2006 : 3:41:22 PM
try

b2 = ocrs.eof;

as EOF is defined in stdio.h as (-1) so your code will become

b2 = ocrs.(-1)

after preprocessing.

Since C is case sensitive and COM part not, this should work.


CP



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000