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
Topic
jguenrdc
USA
Posts
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
cpyang
USA
1406 Posts
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
Topic
New Topic
Reply to Topic
Printer Friendly
Jump To:
Select Forum
Origin Forum
Origin Forum
Origin Viewer Forum
Origin Forum for Programming
Forum for Python
LabTalk Forum
Forum for Origin C
Forum for Automation Server/COM and LabVIEW
Origin中文论坛
Origin 中文论坛 (Chinese Origin Forum)
Japanese Origin Forum
Origin日本語フォーラム (Japanese Origin Forum)
Origin on Linux
The Origin on Linux Forum
Private Forums
Distributor Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000