[dba-VB] Converting the value in a field

Bobby Heid bheid at sc.rr.com
Sat Dec 1 15:37:10 CST 2007


Hi John,

Yes, CInt will work.
As will: 
	mintNumOfRecsToExport = Ctype(!EDS_FileSize,Integer) and 
	mintNumOfRecsToExport = Convert.ToInt32(!EDS_FileSize)

Bobby

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Saturday, December 01, 2007 12:04 PM
To: dba-vb at databaseadvisors.com; dba-sqlserver at databaseadvisors.com
Subject: [dba-VB] Converting the value in a field

I have lines of code like this:

mintNumOfRecsToExport = !EDS_FileSize

The compile complains because !EDS_FileSize is an object (a field) and
mintNumOfRecsToExport is an integer variable.  The error is:

Error	2	Option Strict On disallows implicit conversions from
'Object' to 'Integer'.	

There is no .Value property for the field object !EDS_FileSize.  Will simply
wrapping the object in CInt() fix the problem, or will I get an integer
pointer to the object?  

John W. Colby
Colby Consulting
www.ColbyConsulting.com 






More information about the dba-VB mailing list