Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Update query in MySQL crashing access, runs fine against MSSQL

Posted on 2013-06-20
4
Medium Priority
?
639 Views
Last Modified: 2013-06-26
I am in the middle of trying to convert my first database from MSSQL to MySQL. The code in question is this:

Update Orders 
Set Paid=1 
Where 
(Select Sum(PaymentAmount) 
ordersFrom Payment 
Where Payment.InvoiceNumber=Orders.OrderNumber)>=InvoiceTotal

Open in new window


The objective is to mark all orders as paid if the customer has made sufficient payments. Payments are entered into a separate system and not directly onto the order form.

There are over 67000 payments in the payment  table, and over 70000 orders in the order table.

When running the code in an Access ADP file, in Access 2010 against the MSSQL server, it runs fine. When running the code in MySQL Workbench, the code runs fine. When running the code in an Access 2010 MDB file against the MySQL server, Access crashes with the following error in the Windows 7 64bit workstation event log:

Faulting application name: MSACCESS.EXE, version: 14.0.6024.1000, time stamp: 0x4d83e4fc
Faulting module name: ntdll.dll, version: 6.1.7601.17725, time stamp: 0x4ec49b8f
Exception code: 0xc0000374
Fault offset: 0x000ce6c3
Faulting process id: 0x878
Faulting application start time: 0x01ce6dcd7aa3a1a4
Faulting application path: C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE
Faulting module path: C:\Windows\SysWOW64\ntdll.dll
Report Id: c60ea7c2-d9c0-11e2-9dbb-000a3a56e2a7

Open in new window


The MySQL instance is 5.6.11 and the MSSQL instance is 2012 express. The server is a C2D 6600 2.4Ghz with 6GB RAM box.

Suggestions?
0
Comment
Question by:AMPLECOMPUTERS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 15

Assisted Solution

by:gplana
gplana earned 300 total points
ID: 39263089
Try this one:

Update Orders 
Set Paid=1 
Where InvoiceTotal <= 
(Select Sum(PaymentAmount)  orders
From Payment 
Where Payment.InvoiceNumber=Orders.OrderNumber);

Open in new window


Is it failing too?
0
 

Author Comment

by:AMPLECOMPUTERS
ID: 39263490
Running that code gives me a syntax error in Access, it says:

Run-time error '3075':

Syntax error in query expression 'InvoiceTotal<=(Select Sum(PaymentAmount) orders from Payment...blah blah blah.

If I remove the word "orders" from line 4, then it crashes Access just like my code did. It runs either way just fine from the Workbench.
0
 

Accepted Solution

by:
AMPLECOMPUTERS earned 0 total points
ID: 39266466
I have no idea what happened, but I had another place in the database with the same code, and it ran fine. I copies and pasted it into the form that was blowing up, still runs fine. I think the form was corrupt somehow so just to be sure I did a decompile and recompile.

Regardless, the problem is solved.
0
 

Author Closing Comment

by:AMPLECOMPUTERS
ID: 39277391
I will award 100 for trying, at least it made me really look hard a the database which did lead to a solution.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question