Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / November 2007



Tip: Looking for answers? Try searching our database.

Data Definition for Numeric data type

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DK - 21 Nov 2007 15:20 GMT
I have a data base table (in FoxPro DBF table) which has a definition
of Numeric(5,1). I have understood this to mean that the total field
width is 5 digits with one being a decimal digit and within the 5
digits there is space for  decimal point so that the largest value can
be 999.9.

Using ADO I can push a value of 1000 into this field but I cannot use
ADO and read this field without getting an Efail status or no data
returned.

Does any one have any idea of how to get around this problem?

Why does ADO allow you to insert a value that exceeds the field spec
and then does not allow you to read that value?
Ralph - 23 Nov 2007 00:24 GMT
> I have a data base table (in FoxPro DBF table) which has a definition
> of Numeric(5,1). I have understood this to mean that the total field
[quoted text clipped - 10 lines]
> Why does ADO allow you to insert a value that exceeds the field spec
> and then does not allow you to read that value?

Not sure what you are doing or what is wrong - "push"? "Efail"? ...

Are you using classic ADO or ADO.Net? Classic VB (VB6 or lower) or VB.Net?

If you are using classic ADO and VB then the first thing is to make sure you
have the latest 'n greatest FoxPro Provider:
http://msdn.microsoft.com/vfoxpro/downloads/updates/default.aspx

Second, the Numeric datatype is not directly supported in VB. The closest
match is a Decimal which is supported only in a variant. Look up "CDec()".

IIRC, the precision specification for a Numeric/Decimal is the total number
of digits - not including the decimal point (or that the +/- either). ie,
your example would be 9999.9.

Also note if using classic ADO each of the values in a Recordset is a
Variant.

If your not using classic ADO or if you are using VB.Net then you need to
post in a dotNet newsgroup.

In any case posting code will make it easier to understand what you are
doing.

hth
-ralph
DK - 26 Nov 2007 15:46 GMT
> > I have a data base table (in FoxPro DBF table) which has a definition
> > of Numeric(5,1). I have understood this to mean that the total field
[quoted text clipped - 36 lines]
> hth
> -ralph

It's VB6 and historically if the the data in the field does not match
exactly the field spec you will either get some strang EFail staus
that tells yo nothing or get no data returned in the record set.

The code is very simple "Select * from Table", if any of the rows that
would have been returned has this field no data will be returned in
the recordset but if you include all but the offending field data will
be returned.

Usually this is used to build a grid with all of the available records
in it (it does have a where clause and a limited set of fields)  and
then you can select one of the rows and retrieve the balance of the
data. BUT if the row you selected has the offending field then you get
no records returned in other words you get an immediate EOF.

It makes no difference which of the various OLEDB drivers for FoxPro
gets used. I have found by experimentation that the older ODBC driver
will return data.
Ralph - 26 Nov 2007 18:11 GMT
> > "DK" <dwes...@ermco-eci.com> wrote in message

<snipped>

> It's VB6 and historically if the the data in the field does not match
> exactly the field spec you will either get some strang EFail staus
[quoted text clipped - 14 lines]
> gets used. I have found by experimentation that the older ODBC driver
> will return data.

That is strange. I've never had any particular problem of that sort with the
Numeric datatype. Without something I can reproduce I not going to be much
help.

The FoxPro guru around here is Cindy. Hopefully she will show up and help.
[Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP
cindy_winegar...@msn.com  www.cindywinegarden.com ]

-ralph
DK - 27 Nov 2007 14:28 GMT
> > > "DK" <dwes...@ermco-eci.com> wrote in message
>
[quoted text clipped - 30 lines]
>
> - Show quoted text -

Ralph,
I think Cindy has looked at this problem in the past just thought
there may be something new out there.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.