Re: Access violation - probably not the fault of Postgres

From: Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Access violation - probably not the fault of Postgres
Date: 2007-03-12 01:04:18
Message-ID: 45F4A712.8090105@autoledgers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Paul Lambert wrote:
> David Gardner wrote:
>> Could you post the code in question? How are you initializing your
>> recordset object? Have you tried feeding the database object an insert
>> statement via the execute() function?
>>
>>
>

A few more case examples to go with the previously posted code...

Record does not exist in the database, the following is therefore trying
to add it.

"12/03/2007 7:04:36 AM dbg 80- [+loading sundry product table]"
"12/03/2007 7:04:36 AM dbg 70-
[+load_table(Sundry_Product,Product_id,Dealer_id,Franchise,Workshop,Price_Type)]"
"12/03/2007 7:04:36 AM dbg 60- [Criteria = Product_id = 'BULLBAR' and
Dealer_id = 'F65' and Franchise = 'BLANK' and Workshop = '0' and
Price_Type = '0']"
"12/03/2007 7:04:36 AM dbg 60- [Opening table with criteria=Select *
from Sundry_Product where Product_id = 'BULLBAR' and Dealer_id = 'F65'
and Franchise = 'BLANK' and Workshop = '0' and Price_Type = '0']"
"12/03/2007 7:04:53 AM dbg 60- [Record not found, adding new]"
"12/03/2007 7:04:53 AM dbg 80- [ + load_xxx_to_db]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DEALER_ID.value to F65]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DATE_CHANGED.value to 06-Mar-2007]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
TIME_CHANGED.value to 1809]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRODUCT_ID.value to BULLBAR]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DES_1.value to Bullbar]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DES_2.value to ]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DES_3.value to ]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DES_4.value to ]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRODUCT_TYPE.value to S]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRODUCT_SALES_GROUP.value to 45]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_1.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_2.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_3.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_4.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
COST.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PARTS_HANDLING.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
INCLUDING_SALES_TAX.value to ]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PARTS_HANDLING_LIMIT.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
HANDLING_LIMIT_PER_PART.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_TYPE.value to ]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_PERCENTAGE.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
MARK_UP_PERCENTAGE.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
ROUND_UP_TO.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
SUBTRACT_FROM_ROUND_UP.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_MINIMUM.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_MAXIMUM.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
SUPPLIER_NO.value to 113]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
HANDLING_LIMIT_PER_RO.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
OBSOLETE.value to ]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
FRANCHISE.value to BLANK]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
WORKSHOP.value to 0]"
"12/03/2007 7:04:53 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_TYPE.value to 0]"
"12/03/2007 7:04:53 AM dbg 60- [ - load_xxx_to_db exit status 0]"
"12/03/2007 7:04:53 AM dbg 60- [ + updating table]"
<Access violation terminates program>

I then manually added an empty record with the 5 primary key fields
having the same value as
what my program has been trying to add and then piped the data into my
program to try
again.

"12/03/2007 7:06:26 AM dbg 80- [+loading sundry product table]"
"12/03/2007 7:06:26 AM dbg 70-
[+load_table(Sundry_Product,Product_id,Dealer_id,Franchise,Workshop,Price_Type)]"
"12/03/2007 7:06:26 AM dbg 60- [Criteria = Product_id = 'BULLBAR' and
Dealer_id = 'F65' and Franchise = 'BLANK' and Workshop = '0' and
Price_Type = '0']"
"12/03/2007 7:06:26 AM dbg 60- [Opening table with criteria=Select *
from Sundry_Product where Product_id = 'BULLBAR' and Dealer_id = 'F65'
and Franchise = 'BLANK' and Workshop = '0' and Price_Type = '0']"
"12/03/2007 7:06:43 AM dbg 60- [Record found, updating]"
"12/03/2007 7:06:43 AM dbg 80- [ + load_xxx_to_db]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DEALER_ID.value to F65]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DATE_CHANGED.value to 06-Mar-2007]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
TIME_CHANGED.value to 1809]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRODUCT_ID.value to BULLBAR]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DES_1.value to Bullbar]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DES_2.value to ]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DES_3.value to ]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DES_4.value to ]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRODUCT_TYPE.value to S]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRODUCT_SALES_GROUP.value to 45]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_1.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_2.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_3.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_4.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
COST.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PARTS_HANDLING.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
INCLUDING_SALES_TAX.value to ]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PARTS_HANDLING_LIMIT.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
HANDLING_LIMIT_PER_PART.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_TYPE.value to ]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_PERCENTAGE.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
MARK_UP_PERCENTAGE.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
ROUND_UP_TO.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
SUBTRACT_FROM_ROUND_UP.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_MINIMUM.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
DISC_MAXIMUM.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
SUPPLIER_NO.value to 113]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
HANDLING_LIMIT_PER_RO.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
OBSOLETE.value to ]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
FRANCHISE.value to BLANK]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
WORKSHOP.value to 0]"
"12/03/2007 7:06:43 AM dbg 90- [ + load_xxx_to_db > Setting
PRICE_TYPE.value to 0]"
"12/03/2007 7:06:43 AM dbg 60- [ - load_xxx_to_db exit status 0]"
"12/03/2007 7:06:43 AM dbg 60- [ + updating table]"
"12/03/2007 7:06:46 AM dbg 60- [ - updating table]"
"12/03/2007 7:06:46 AM dbg 60- [-load_table]"

Success!

Would this be some sort of permissions problem?

To make matters more interesting, my program was adding two records into
another table, said table was empty, thus adding new records in both
cases. The first one worked but the second one caused an access violation.

"12/03/2007 7:07:30 AM dbg 80- [+loading deal line table]"
"12/03/2007 7:07:30 AM dbg 70-
[+load_table(Deal_lines,Address,Dealer_id,,,)]"
"12/03/2007 7:07:30 AM dbg 60- [Criteria = Address = '73969' and
Dealer_id = 'F65']"
"12/03/2007 7:07:30 AM dbg 60- [Opening table with criteria=Select *
from Deal_lines where Address = '73969' and Dealer_id = 'F65']"
"12/03/2007 7:07:41 AM dbg 60- [Record not found, adding new]"
"12/03/2007 7:07:41 AM dbg 80- [ + load_xxx_to_db]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
DEALER_ID.value to F65]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
DATE_CHANGED.value to 06-Mar-2007]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
TIME_CHANGED.value to 1813]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
DEAL_ADDRESS.value to 0]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
LINE_TYPE.value to V]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
ADDRESS.value to 73969]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
DELETED.value to 30]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
VEHICLE_ADDRESS.value to 1001]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
DEAL_NO.value to 1]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
ORDER_CODE.value to 99COST_ADJUST]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
REFERENCE.value to ]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
ORDER_DESC.value to Vehicle Cost Adjust]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_PRICE.value to 0]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_TAX.value to 0]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_COST.value to 1290.56]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_PAYMENT.value to 0]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
FORMAT_CODE.value to ]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_CODE.value to C]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
OPTION_CODE.value to ]"
"12/03/2007 7:07:41 AM dbg 90- [ + load_xxx_to_db > Setting
OPTION_SEQUENCE.value to ]"
"12/03/2007 7:07:41 AM dbg 60- [ - load_xxx_to_db exit status 0]"
"12/03/2007 7:07:41 AM dbg 60- [ + updating table]"
"12/03/2007 7:07:42 AM dbg 60- [ - updating table]"
"12/03/2007 7:07:42 AM dbg 60- [-load_table]"
<this indicates it completed succesfully>
"12/03/2007 7:07:42 AM dbg 10- [-process_dmq_message]"
"12/03/2007 7:07:42 AM dbg 80- [+read_dmq_message: Processed message,
ODBC State 0]"
"12/03/2007 7:07:42 AM dbg 80- [confirming message]"
"12/03/2007 7:07:42 AM dbg 80- [-read_dmq_message]"
"12/03/2007 7:07:42 AM dbg 80- [+read_dmq_message]"
"12/03/2007 7:07:42 AM dbg 80- [+read_dmq_message: Message Read with
Status = 1]"
"12/03/2007 7:07:42 AM dbg 80- [validating DmQ header]"
"12/03/2007 7:07:42 AM dbg 10- [+process_dmq_message]"
"12/03/2007 7:07:42 AM dbg 80- [+extract_items]"
"12/03/2007 7:07:42 AM dbg 80- [-extract_items]"
"12/03/2007 7:07:42 AM dbg 80- [+unpack_items]"
"12/03/2007 7:07:42 AM dbg 80- [-unpack_items]"
"12/03/2007 7:07:42 AM dbg 80- [+loading deal line table]"
"12/03/2007 7:07:42 AM dbg 70-
[+load_table(Deal_lines,Address,Dealer_id,,,)]"
"12/03/2007 7:07:42 AM dbg 60- [Criteria = Address = '73970' and
Dealer_id = 'F65']"
"12/03/2007 7:07:42 AM dbg 60- [Opening table with criteria=Select *
from Deal_lines where Address = '73970' and Dealer_id = 'F65']"
"12/03/2007 7:07:46 AM dbg 60- [Record not found, adding new]"
"12/03/2007 7:07:46 AM dbg 80- [ + load_xxx_to_db]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
DEALER_ID.value to F65]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
DATE_CHANGED.value to 06-Mar-2007]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
TIME_CHANGED.value to 1813]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
DEAL_ADDRESS.value to 0]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
LINE_TYPE.value to P]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
ADDRESS.value to 73970]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
DELETED.value to 30]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
VEHICLE_ADDRESS.value to 1001]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
DEAL_NO.value to 1]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
ORDER_CODE.value to ABULLBAR GEN]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
REFERENCE.value to ]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
ORDER_DESC.value to Bullbar.]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_PRICE.value to 1500]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_TAX.value to 136.36]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_COST.value to 1363.64]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_PAYMENT.value to 1500]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
FORMAT_CODE.value to ]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
INVOICE_CODE.value to C]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
OPTION_CODE.value to ]"
"12/03/2007 7:07:46 AM dbg 90- [ + load_xxx_to_db > Setting
OPTION_SEQUENCE.value to ]"
"12/03/2007 7:07:46 AM dbg 60- [ - load_xxx_to_db exit status 0]"
"12/03/2007 7:07:46 AM dbg 60- [ + updating table]"
<Access violation terminates program>

The first example points to a possible permissions problem, can update
but not add - but the second example counters that by being able to add
one record but not another which would point to something in the data...
both completely contradicting each other. :(

I'm tearing my hair out here (which is not really a problem since I'm
shaving it all off for charity on Friday) trying to get this thing
working... it's got me completely boggled.

I'm in the process of setting up a small test case to rule out or
confirm the data as being the problem. But that will have to wait until
tomorrow to finish so I'll let you know what I find then, but if anyone
has any other thoughts between now and then, I'd love to hear them.

Thanks,
Paul.

--
Paul Lambert
Database Administrator
AutoLedgers

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message noreply 2007-03-12 07:10:22 [ psqlodbc-Bugs-1000681 ] Error when using ODBC driver with Microsoft Access
Previous Message noreply 2007-03-11 19:13:50 [ psqlodbc-Bugs-1000681 ] Error when using ODBC driver with Microsoft Access