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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Object has EOF property - how do I access it?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jguenrdc

USA
Posts

Posted - 05/30/2006 :  6:02:00 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

cpyang

USA
1406 Posts

Posted - 06/01/2006 :  3:41:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000