[dba-VB] Converting the value in a field

jwcolby jwcolby at colbyconsulting.com
Sun Dec 2 01:18:04 CST 2007


And which type is faster?  CInt smells of VB6 compatibility code. 


John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Bobby Heid
Sent: Saturday, December 01, 2007 4:37 PM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] Converting the value in a field

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 



_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list