Hi all
I am using odbc from win32 extensions to connect to MS SQL Server. I
use mx.DateTime to handle dates. When I select a datetime column from
the database, odbc returns something called a DbiDate object. I cannot
find out any information on this type, but mx can convert it to a
mx.DateTime object using DateTimeFrom(), which is really all that I
need.
I am looking into changing from mx.DateTime to using the builtin
datetime type, but I cannot figure out how to convert a DbiDate object
to a datetime object.
First prize would be to have a datetime constructor that takes a
DbiDate object as input, in the same way that mx does, but this does
not seem to exist.
Second prize would be to extract the year/month/day elements from the
DbiDate object, and construct the datetime object manually. However, if
I try dir(d), where d is a DbiDate object, I get an empty list, so I
cannot even see how to extract the elements.
Does anyone know if this is possible, and if so, how?
Many thanks
Frank Millman 1 3252
Frank Millman wrote: Hi all
I am using odbc from win32 extensions to connect to MS SQL Server. I use mx.DateTime to handle dates. When I select a datetime column from the database, odbc returns something called a DbiDate object. I cannot find out any information on this type, but mx can convert it to a mx.DateTime object using DateTimeFrom(), which is really all that I need.
I am looking into changing from mx.DateTime to using the builtin datetime type, but I cannot figure out how to convert a DbiDate object to a datetime object.
First prize would be to have a datetime constructor that takes a DbiDate object as input, in the same way that mx does, but this does not seem to exist.
Second prize would be to extract the year/month/day elements from the DbiDate object, and construct the datetime object manually. However, if I try dir(d), where d is a DbiDate object, I get an empty list, so I cannot even see how to extract the elements.
Does anyone know if this is possible, and if so, how?
Many thanks
Frank Millman
I've always used
from mx.DateTime import DateTimeFromCOMDate
t=DateTimeFromCOMDate(dbidate)
Larry Bates This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jim S. |
last post by:
I'm having a horrible time simply inserting the date in a MySQL
database through a Visual Basic program. I have a table, called
"ORDERS"; "ID" is the primary key. I'm trying the insert the date,...
|
by: DerekS |
last post by:
Hi,
I've been pulling my hair out trying to write a simple method to
programatically create a system DSN with all parameters on a remote machine.
I have ensured I have the correct permissions on...
|
by: Roland Wolters |
last post by:
Hi,
I am reading data from a unix odbc datasource in a c# program. Reading the
data as works fine, but one field, contains a date-time format that .net
does not understand.
The query would...
|
by: flupke |
last post by:
I'm using a solid DB and i'm accessing it via the odbc module
(activepython).
I get a DbiDate object returned but i don't find a way to decently print
it or get a format like %d/%m%/%y.
I found...
|
by: Henrik Dahl |
last post by:
Hello!
I have an xml schema which has a date typed attribute. I have used xsd.exe
to create a class library for XmlSerializer. The result of
XmlSerializer.Serialize(...) should be passed as the...
|
by: TBoon |
last post by:
I have a vb.net program to read DATETIME column from MSSQL and write to a
TXT file.
And I notice that the DATETIME format in the TXT file changed according to
my machine datetime setting in...
|
by: dyork |
last post by:
When getting data from a database using the dbapi and an SQL query, how do
you in general round trip the data? Especially date-time?
An SQL datetime column translates nicely into a Python...
|
by: Greg Corradini |
last post by:
Hello,
Lately I've been using the mx.ODBC module to query Access (mdb) tables. For
the life of me, I can't get the 'create table' sql command to work. I use
this command in Oracle and I've seen...
|
by: boblatest |
last post by:
Hello,
I wrote aprogram that imports odbc and dbi. Originally I used PyWin,
but now I prefer IDLE for working in Windows. Anyway, when I start my
program from IDLE, it can't import the odbc and...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |