Solved

Update query in MySQL crashing access, runs fine against MSSQL

Posted on 2013-06-20
4
629 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 100 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

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.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

622 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