SCM

[#1000616] INSERT and UPDATE does not work via ADODB

View Trackers | Bugs | Download .csv | Monitor

Date:
2006-04-21 09:15
Priority:
3
State:
Open
Submitted by:
Barbara Epis (bepis)
Assigned to:
Nobody (None)
Category:
Missing functionality
Group:
Resolution:
None
 
Summary:
INSERT and UPDATE does not work via ADODB

Detailed description
Environment:
Windows XP SP2
VB 6 SP5 and ADO
PostgreSQL 8.03
OLE DB provider 1.0.0.20

Dim strSql As String
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset

‘ DNS connection works fine
'conn.Open "DSN=test;Uid=test;Pwd=xxx;"

‘ DNS-less connection works fine
'conn.Open "driver={PostgreSQL ANSI};server=localhost;port=5432;database=test;uid=test;pwd=xxx;ksqo=;"

conn.Open "Provider=PostgreSQL OLE DB Provider;Password=xxx;User ID=test;Data Source=localhost;Location=test;Extended Properties="""""

strSql = "SELECT * FROM table"

rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
rs.LockType = adLockOptimistic
rs.ActiveConnection = conn
rs.Source = strSql

rs.Open
rs("field") = "fieldvalue"

'ERROR -2147217887
'Multiple-step OLE DB operation generated errors.
'Check each OLE DB status value, if available. No work was done

rs.Update
rs.Close

1. INSERT and UPDATE does not work via ADODB --> Error
2. DB_Connection.Execute ... works fine
3. SELECT works fine via ADO

Followup

Message
Date: 2006-08-17 05:43
Sender: Victor Snezhko

Files moved to http://people.indorsoft.ru/vvs/pgoledb.html

I'll set up the redirects soon
Date: 2006-08-16 19:55
Sender: Nobody

Hi IM trying to get http://indorsoft.ru/PgOleDb.zip but the link is not working, Can anyone tell me where I can find the solution of this problem.
Date: 2006-04-21 18:42
Sender: Victor Snezhko

Hello, Barbara!

I am currently working on this problem.
Solution is not fully committed yet, but in the meantime you could download compiled bleeding-edge version of the provider from http://indorsoft.ru/PgOleDb.zip

It should work. Please report any visible problems, though.

P.S.: Code taken from CVS with this patch:
Index: TypeInfo.h
===================================================================
RCS file: /cvsroot/oledb/oledb/TypeInfo.h,v
retrieving revision 1.20
diff -u -r1.20 TypeInfo.h
--- TypeInfo.h 20 Apr 2006 11:54:18 -0000 1.20
+++ TypeInfo.h 21 Apr 2006 10:50:52 -0000
@@ -148,7 +148,7 @@
colinfo->ulColumnSize=PQfsize( res, field_num );
if( colinfo->ulColumnSize<0 )
colinfo->ulColumnSize=~0;
- colinfo->dwFlags=DBCOLUMNFLAGS_MAYBENULL|
+ colinfo->dwFlags=DBCOLUMNFLAGS_MAYBENULL|DBCOLUMNFLAGS_WRITE|
(colinfo->ulColumnSize==~0?0:DBCOLUMNFLAGS_ISFIXEDLENGTH);
colinfo->wType=DBTYPE_UDT; // User Defined Type
colinfo->bPrecision=~0;

Date: 2006-04-21 10:57
Sender: Victor Snezhko

Hello, Barbara!

I am currently working on this problem.
Solution is not fully committed yet, but in the meantime you could download compiled bleeding-edge version of the provider from http://indorsoft.ru/PgOleDb.zip

It should work. Please report any visible problems, though.

P.S.: Code taken from CVS with this patch:
Index: TypeInfo.h
===================================================================
RCS file: /cvsroot/oledb/oledb/TypeInfo.h,v
retrieving revision 1.20
diff -u -r1.20 TypeInfo.h
--- TypeInfo.h 20 Apr 2006 11:54:18 -0000 1.20
+++ TypeInfo.h 21 Apr 2006 10:50:52 -0000
@@ -148,7 +148,7 @@
colinfo->ulColumnSize=PQfsize( res, field_num );
if( colinfo->ulColumnSize<0 )
colinfo->ulColumnSize=~0;
- colinfo->dwFlags=DBCOLUMNFLAGS_MAYBENULL|
+ colinfo->dwFlags=DBCOLUMNFLAGS_MAYBENULL|DBCOLUMNFLAGS_WRITE|
(colinfo->ulColumnSize==~0?0:DBCOLUMNFLAGS_ISFIXEDLENGTH);
colinfo->wType=DBTYPE_UDT; // User Defined Type
colinfo->bPrecision=~0;

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge