Bugs
Search the entire project
This project's trackers
This project's forums
This project's tasks
This project's releases
This project's documents
This project's news
Project
People
Skill
Advanced search
Log In
|
New Account
Home
My Page
Projects
Code Snippets
Project Openings
PostgreSQL OLE DB provider for Windows
Summary
Activity
Forums
Tracker
Lists
Tasks
Docs
Surveys
News
SCM
Files
[#1000621] Error update a table that contains a TIMESTAMP or DATE field type
View Trackers
|
Bugs
|
Download .csv
|
Monitor
Date:
2006-04-27 14:13
Priority:
3
State:
Open
Submitted by:
Barbara Epis (
bepis
)
Assigned to:
Nobody (None)
Category:
Group:
Resolution:
None
Summary:
Error update a table that contains a TIMESTAMP or DATE field type
Detailed description
Hello Victor,
I’m afraid I’m experimenting a new problem with the OLEDB provider…
It is not possible to update any field in a table that contains a TIMESTAMP or DATE field if the field contains a not null value.
Herewith enclosed you can find the CREATE TABLE statement and a code fragment that should make you able to reproduce the problem.
Environment:
Windows XP SP2
VB 6 SP5 and ADO
PostgreSQL 8.03
OLE DB provider 1.0.0.20
Table:
CREATE TABLE TESTTABLE2 (
ID SERIAL NOT NULL,
DESCR VARCHAR (255),
FDATE TIMESTAMP,
CONSTRAINT PK_ID2
PRIMARY KEY ( ID ) ) ;
Rows:
INSERT INTO TESTTABLE2 ( DESCR, FDATE ) VALUES (
'First descr', '01/01/2001');
INSERT INTO TESTTABLE2 ( DESCR, FDATE ) VALUES (
'Sec descr', '10/01/2001');
Code:
Dim strSql As String
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "Provider=PostgreSQL OLE DB Provider;Password=xxx;User ID=test;Data Source=localhost;Location=test;Extended Properties="""""
strSql = "SELECT * FROM testtable2"
rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.ActiveConnection = conn
rs.Source = strSql
rs.Open
rs("descr") = "First descr new"
rs.update ' Errore di runtime -2147467259
' Il provider di dati o un'altro servizio ha restituito uno stato E-FAIL
rs.Close
Barbara
Followup
Message
Date: 2006-04-27 18:15
Sender:
Victor Snezhko
Hi Barbara,
this is a known problem, the provider just lacks this functionality so far.
I hope I'll provide a patch next week, and until that time you can take the version I use myself. I have updated it here:
http://indorsoft.ru/PgOleDb.zip
It transmits dates, times and timestamps as text to postgresql. This is a temporary solution until me or somebody else writes support for uploading binary date/times to postgresql (read support is already present, so it won't be hard, I just had more urgent issues to resolve all this time).
Just in case here is the patch:
http://indorsoft.ru/pgoledb-time.diff
It should be used with the patch that allows write support (published as followup to the bug
[#1000616]
)
--
Victor
Attached Files:
Changes:
No Changes Have Been Made to This Item