3259 - Invalid Field data type with DAO 3.6 in VB 
Author Message
 3259 - Invalid Field data type with DAO 3.6 in VB

Hi there,

I'm developing a tiny program with DAO 3.6 in VB 6. This program will create
the database and all tables in it. There's a specific Table in the Database
of this program that has a field defined as dbTime. When I run the program,
it checks for the database to see if it exists, when reaches this table, I
get the error 3259 - Invalid Field data type and the cursor stops at this db
constant: dbTime which as weird as it seams, vb recongnizes as a reserved
const. I can't get arround this.

Can any one help me?

Thanks.


NC



Thu, 03 Oct 2013 17:06:41 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB

Quote:

> I'm developing a tiny program with DAO 3.6 in VB 6. This program will create
> the database and all tables in it. There's a specific Table in the Database
> of this program that has a field defined as dbTime. When I run the program,
> it checks for the database to see if it exists, when reaches this table, I
> get the error 3259 - Invalid Field data type and the cursor stops at this db
> constant: dbTime which as weird as it seams, vb recongnizes as a reserved
> const. I can't get arround this.

I don't think a time field is what you intended to create.
From DAO 3.60 help:
 | Time data type
 | A data type that stores a time value. The value is dependent on the
 | clock setting of the data source.

To store a time value you should use dbDate, thus creating a field
of Date/Time data type.
There is only a Date/Time data type in VB6, no Time data type.
dbtime is a constant defined by DAO3.60, not VB6.

[...]

Quote:


> NC

Which forum?
Your question was posted to the microsoft.public.vb.general.discussion
_newsgroup_ of the UseNet.

HTH.

Helmut.



Thu, 03 Oct 2013 19:22:15 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB
Hi There,

Eaven if I want to store a time in the format Hours:minutes:seconds ?
But using that type, dbDate, How do I define the format for HH:MM:SS.?

NC


Quote:

>> I'm developing a tiny program with DAO 3.6 in VB 6. This program will
>> create
>> the database and all tables in it. There's a specific Table in the
>> Database
>> of this program that has a field defined as dbTime. When I run the
>> program,
>> it checks for the database to see if it exists, when reaches this table,
>> I
>> get the error 3259 - Invalid Field data type and the cursor stops at this
>> db
>> constant: dbTime which as weird as it seams, vb recongnizes as a reserved
>> const. I can't get arround this.

> I don't think a time field is what you intended to create.
> From DAO 3.60 help:
> | Time data type
> | A data type that stores a time value. The value is dependent on the
> | clock setting of the data source.

> To store a time value you should use dbDate, thus creating a field
> of Date/Time data type.
> There is only a Date/Time data type in VB6, no Time data type.
> dbtime is a constant defined by DAO3.60, not VB6.

> [...]


>> NC

> Which forum?
> Your question was posted to the microsoft.public.vb.general.discussion
> _newsgroup_ of the UseNet.

> HTH.

> Helmut.



Thu, 03 Oct 2013 21:19:45 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB


Quote:
> Hi There,

> Eaven if I want to store a time in the format Hours:minutes:seconds ?
> But using that type, dbDate, How do I define the format for HH:MM:SS.?

You don't; formatting is a display issue.  When you read the data and show
it to the user you can format it any way you want to.


Thu, 03 Oct 2013 23:24:28 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB
So bottom line.....if I want to store a Time, in the form HH:MM:SS the field
will store a full date (dd-mm-yyyy hh:mm:ss) is that correct?

NC

Quote:



>> Hi There,

>> Eaven if I want to store a time in the format Hours:minutes:seconds ?
>> But using that type, dbDate, How do I define the format for HH:MM:SS.?

> You don't; formatting is a display issue.  When you read the data and show
> it to the user you can format it any way you want to.



Fri, 04 Oct 2013 01:36:50 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB
NC asked:

Quote:
> So bottom line.....if I want to store a Time, in the form HH:MM:SS the field
> will store a full date (dd-mm-yyyy hh:mm:ss) is that correct?

No.
Look-up the Date/time data format in VB6 (or Access). It's internally
stored as a double, consisting of the date (the iteger part) and the
time (the fractional part). Midnight is .000, 3:00 AM is .125, 6:00 AM
is .250, midday is .500, 6:00 PM is .750, ...

The date part is just the number of days since 30 December 1899,
negative whole numbers represent dates before 30 December 1899.

If you want to store only time values, use something like this:
myTimeValue = cDate("10:55:31")
Use the Format statement do display the time value any way you want to.

Helmut.



Fri, 04 Oct 2013 04:55:25 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB
Thanks HM.


Quote:
> NC asked:
>> So bottom line.....if I want to store a Time, in the form HH:MM:SS the
>> field
>> will store a full date (dd-mm-yyyy hh:mm:ss) is that correct?

> No.
> Look-up the Date/time data format in VB6 (or Access). It's internally
> stored as a double, consisting of the date (the iteger part) and the
> time (the fractional part). Midnight is .000, 3:00 AM is .125, 6:00 AM
> is .250, midday is .500, 6:00 PM is .750, ...

> The date part is just the number of days since 30 December 1899,
> negative whole numbers represent dates before 30 December 1899.

> If you want to store only time values, use something like this:
> myTimeValue = cDate("10:55:31")
> Use the Format statement do display the time value any way you want to.

> Helmut.



Fri, 04 Oct 2013 06:28:27 GMT  
 3259 - Invalid Field data type with DAO 3.6 in VB

Quote:

>So bottom line.....if I want to store a Time, in the form HH:MM:SS the field
>will store a full date (dd-mm-yyyy hh:mm:ss) is that correct?

The date (double precision float) will store any date and time from January 1,
100 to (I believe) December 31, 9999.  Whole numbers are dates, decimals are
times.  

Use cdate( ) to convert a number to a date and cdbl( ) to convert a date to a
number.  Remember to put the date in ##, such as  cdbl(# Jan 21, 1931 #),
however they are equivalent in code.



Fri, 04 Oct 2013 12:02:06 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. newbie Runtime error 3259: Invalid Field Data Type

2. newbie Runtime error 3259: Invalid Field Data Type

3. dbDecimal field type gives error 3259

4. Changing Field Properties via DAO 3.6

5. Changing Field Properties via DAO 3.6

6. DAO 3.6 and data controls

7. strange data control behaviour with DAO 3.6 and SQL server

8. DAO 3.6 DAta Control wont refresh

9. Data Controls and DAO 3.6

10. DAO 3.6 and Data Controls - Class not registered

11. Moving from DAO 3.5 to DAO 3.6

12. Convert DAO 3.5 to DAO 3.6 Jet Engine 4.0

 

 
Powered by phpBB® Forum Software