: Strange things with VB6 in adUseServer mode

From: Thomas Chabaud <tc(at)geosys(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: : Strange things with VB6 in adUseServer mode
Date: 2005-11-14 15:56:35
Message-ID: 4378B3B3.2010604@geosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hello.

I'm using PostgreSQL ODBC Driver v08.01.0100 with Visual Basic 6
applications.
When I try an AddNew on a recordset with the following code :

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "tRepertoiresParcellaires", dbConn,adOpenKeyset, _
adLockPessimistic, adCmdTableDirect

rs.AddNew
rs("myfield").value = "myvalue"

I have always the same error :
"-2147467259 Error while executing the query;
ERROR: null value in column "mycolumn" violates not-null constraint"

- Here's the log files :

Global Options: Version='08.01.0100', fetch=100, socket=0,
unknown_sizes=254, max_varchar_size=8190, max_longvarchar_size=0
disable_optimizer=1, ksqo=3, unique_index=1,
use_declarefetch=0
text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1 NAMEDATALEN=64
extra_systable_prefixes='dd_', conn_settings=''
conn_encoding='OTHER'
conn=135799344, query='select version()'
[ PostgreSQL version string = 'PostgreSQL 8.0.4 on i686-pc-mingw32,
compiled by GCC gcc.exe (GCC) 3.4.2 (mingw-special)' ]
[ PostgreSQL version number = '8.0' ]
conn=135799344, query='set DateStyle to 'ISO''
conn=135799344, query='set geqo to 'OFF''
conn=135799344, query='set extra_float_digits to 2'
conn=135799344, query='select oid from pg_type where typname='lo''
[ Large Object oid = 17612 ]
conn=135799344, query='select pg_client_encoding()'
[ Client encoding = 'SQL_ASCII' (code = 0) ]
conn=135799344, PGAPI_DriverConnect(out)='DRIVER={PostgreSQL
Unicode};DATABASE=cartagri;SERVER=pctc;PORT=5432;SSLMODE=prefer;UID=postgres;
PWD=xxxxxxxx;ReadOnly=0;Protocol=6.4;FakeOidIndex=0;ShowOidColumn=1;RowVersioning=1;
ShowSystemTables=0;ConnSettings=;Fetch=100;Socket=4096;UnknownSizes=0;MaxVarcharSize=254;
MaxLongVarcharSize=8190;Debug=1;CommLog=1;Optimizer=1;Ksqo=3;UseDeclareFetch=0;TextAsLongVarchar=1;
UnknownsAsLongVarchar=0;BoolsAsChar=1;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;
LFConversion=1;UpdatableCursors=0;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;
UseServerSidePrepare=0;LowerCaseIdentifier=0'
DESCRIPTOR ERROR: func=PGAPI_SetDescField, desc='', errnum=11,
errmsg='bad parameter number'
conn=135799344, query='SELECT * FROM tTypesContrats'
conn=135799344, query='select * from tRepertoiresParcellaires'
conn=135799344, query='INSERT INTO tRepertoiresParcellaires DEFAULT VALUES'
STATEMENT ERROR: func=SC_execute, desc='', errnum=7, errmsg='Error while
executing the query'

------------------------------------------------------------
hdbc=135799344, stmt=131743072, result=131757864
manual_result=1, prepare=1, internal=0
bindings=0, bindings_allocated=0
parameters=0, parameters_allocated=0
statement_type=1, statement='INSERT INTO
tRepertoiresParcellaires DEFAULT VALUES'
stmt_with_params='INSERT INTO tRepertoiresParcellaires
DEFAULT VALUES'
data_at_exec=-1, current_exec_param=-1, put_data=0
currTuple=-1, current_col=-1, lobj_fd=-1
maxRows=0, rowset_size=1, keyset_size=0,
cursor_type=0, scroll_concurrency=1
cursor_name='SQL_CUR07DA3D60'
----------------QResult Info
-------------------------------
fields=131760680, manual_tuples=0, backend_tuples=0,
tupleField=0, conn=135799344
fetch_count=101, num_total_rows=0, num_fields=0,
cursor='(NULL)'
message='(NULL)', command='(NULL)', notice='(NULL)'
status=7, inTuples=1
CONN ERROR: func=SC_execute, desc='', errnum=108, errmsg='ERROR: null
value in column "millesime" violates not-null constraint'
------------------------------------------------------------
henv=131780272, conn=135799344, status=1, num_stmts=16

The code was working perfectly with MSAccess database.
Do I need to change something ?

I hope you can help me.

Regards,

Thomas Chabaud

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Peter Eisentraut 2005-11-14 19:09:39 Re: Recommended ODBC version for compilation
Previous Message Claus Scherschel 2005-11-14 13:46:08 Re: Invisible tables in Access 2000