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:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
[quote][i]Originally posted by jguenrdc[/i] [br]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 [/quote]
Check here to include your profile signature.
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
Snitz Forums 2000