Home > Archive > PostgeSQL ODBC > November 2005 > : Strange things with VB6 in adUseServer mode









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author : Strange things with VB6 in adUseServer mode
Thomas Chabaud

2005-11-14, 11:23 am

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 " tRepertoiresParcella
ires", 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=819
0, max_longvarchar_size
=0
disable_optimizer=1,
ksqo=3, unique_index=1,
use_declarefetch=0
text_as_longvarchar=
1, unknowns_as_longvarc
har=0,
bools_as_char=1 NAMEDATALEN=64
extra_systable_prefi
xes='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=ca
rtagri;SERVER=pctc;P
ORT=5432;SSLMODE=pre
fer;UID=postgres;
PWD=xxxxxxxx;ReadOnl
y=0;Protocol=6. 4;FakeOidIndex=0;Sho
wOidColumn=1;RowVers
ioning=1;
ShowSystemTables=0;C
onnSettings=;Fetch=1
00;Socket=4096;Unkno
wnSizes=0;MaxVarchar
Size=254;
MaxLongVarcharSize=8
190;Debug=1;CommLog=
1;Optimizer=1;Ksqo=3
;UseDeclareFetch=0;T
extAsLongVarchar=1;
UnknownsAsLongVarcha
r=0;BoolsAsChar=1;Pa
rse=0;CancelAsFreeSt
mt=0;ExtraSysTablePr
efixes=dd_;
LFConversion=1;Updat
ableCursors=0;Disall
owPremature=0;TrueIs
Minus1=0;BI=0;ByteaA
sLongVarBinary=0;
UseServerSidePrepare
=0;LowerCaseIdentifi
er=0'
DESCRIPTOR ERROR: func=PGAPI_SetDescFi
eld, desc='', errnum=11,
errmsg='bad parameter number'
conn=135799344, query='SELECT * FROM tTypesContrats'
conn=135799344, query='select * from tRepertoiresParcella
ires'
conn=135799344, query='INSERT INTO tRepertoiresParcella
ires 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
tRepertoiresParcella
ires DEFAULT VALUES'
stmt_with_params='IN
SERT INTO tRepertoiresParcella
ires
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_CUR
07DA3D60'
----------------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



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Thomas Chabaud

2005-11-15, 3:23 am

Thomas Chabaud a écrit :
> 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 " tRepertoiresParcella
ires", 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"
>
> [...]


I solve the problem by using adCmdTable, it seems to work in this mode.

Thomas


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com