Forum Discussion
Moving Away from MS Access
I can actually demonstrate this.
The Northwind Traders v1 template app has massive SQL for the Inventory list.
Here is the SQL (as from Access):
SELECT Products.ID AS [Product ID], Products.[Product Name], Products.[Product Code], Nz([Quantity Purchased],0) AS [Qty Purchased], Nz([Quantity Sold],0) AS [Qty Sold], Nz([Quantity On Hold],0) AS [Qty On Hold], [Qty Purchased]-[Qty Sold] AS [Qty On Hand], [Qty Purchased]-[Qty Sold]-[Qty On Hold] AS [Qty Available], Nz([Quantity On Order],0) AS [Qty On Order], Nz([Quantity On Back Order],0) AS [Qty On Back Order], Products.[Reorder Level], Products.[Target Level], [Target Level]-[Current Level] AS [Qty Below Target Level], [Qty Available]+[Qty On Order]-[Qty On Back Order] AS [Current Level], IIf([Qty Below Target Level]>0,IIf([Qty Below Target Level]<[Minimum ReOrder Quantity],[Minimum Reorder Quantity],[Qty Below Target Level]),0) AS [Qty To Reorder]
FROM ((((Products LEFT JOIN [Inventory Sold] ON Products.ID = [Inventory Sold].[Product ID]) LEFT JOIN [Inventory Purchased] ON Products.ID = [Inventory Purchased].[Product ID]) LEFT JOIN [Inventory On Hold] ON Products.ID = [Inventory On Hold].[Product ID]) LEFT JOIN [Inventory On Order] ON Products.ID = [Inventory On Order].[Product ID]) LEFT JOIN [Products On Back Order] ON Products.ID = [Products On Back Order].[Product ID];
SELECT [Inventory Transactions].[Product ID], Sum([Inventory Transactions].Quantity) AS [Quantity Sold]
FROM [Inventory Transactions]
WHERE ((([Inventory Transactions].[Transaction Type])=2))
GROUP BY [Inventory Transactions].[Product ID];
SELECT [Inventory Transactions].[Product ID], Sum([Inventory Transactions].Quantity) AS [Quantity Purchased]
FROM [Inventory Transactions]
WHERE ((([Inventory Transactions].[Transaction Type])=1))
GROUP BY [Inventory Transactions].[Product ID];
SELECT [Purchase Order Details].[Product ID] AS [Product ID], Sum([Purchase Order Details].Quantity) AS [Quantity On Order]
FROM [Purchase Order Details]
WHERE ((([Purchase Order Details].[Posted To Inventory])=False))
GROUP BY [Purchase Order Details].[Product ID];
SELECT [Inventory Transactions].[Product ID], Sum([Inventory Transactions].Quantity) AS [Quantity On Hold]
FROM [Inventory Transactions]
WHERE ((([Inventory Transactions].[Transaction Type])=3))
GROUP BY [Inventory Transactions].[Product ID];
SELECT [Order Details].[Product ID] AS [Product ID], Sum([Order Details].Quantity) AS [Quantity On Back Order]
FROM [Order Details]
WHERE ((([Order Details].[Status ID])=4))
GROUP BY [Order Details].[Product ID];
This SQL is obviously valid only for the MS Access. It takes a significant skill to re-write this to a standard SQL.
What ChatGPT produced is this:
SELECT
p1.ID AS ID,
p1.Product_Name AS Name,
COALESCE(
(SELECT SUM(od.quantity)
FROM order_details od
WHERE p1.ID = od.product_id AND od.status_id = 4),
0) AS quantity_on_back_order,
COALESCE(
(SELECT SUM(it1.quantity)
FROM inventory_transactions it1
WHERE p1.ID = it1.product_id AND it1.transaction_type = 1),
0) AS quantity_purchased,
COALESCE(
(SELECT SUM(it1.quantity)
FROM inventory_transactions it1
WHERE p1.ID = it1.product_id AND it1.transaction_type = 2),
0) AS quantity_sold,
COALESCE(
(SELECT SUM(it1.quantity)
FROM inventory_transactions it1
WHERE p1.ID = it1.product_id AND it1.transaction_type = 3),
0) AS quantity_on_hold,
COALESCE(
(SELECT SUM(po1.quantity)
FROM purchase_order_details po1
WHERE p1.ID = po1.product_id AND po1.posted_to_inventory = 0),
0) AS quantity_on_order,
p1.target_level AS target_level
FROM products p1
GROUP BY p1.ID, p1.Product_Name, p1.target_level ORDER BY p1.ID;
It is 100% accurate. Just look at the quality of this SQL. Amasing.
Of course, up to the user to test the iteration, because it IS the process to get it right.
LEFT join will never produce the same result tho.
What I wanted to point out is there are significant tools on anyone's disposal, to move the Front End and the DB to a new technologies.
But if Access if your bread and butter, that is another matter. The "Powers to Be" do not know what's out there, to make an informed decision.
The problem is, it does not ALWAYS produce functional output.
Sometimes it produces impossible code that can't run. And sometimes it produces code that works, but does not do what you expect.
And it's up to you, the person implementing the solution, to verify it really does what you think it should.
As a tool to speed up development and improve accuracy, ChatGPT is great. But blindly trusting its output in production is a bad idea, and telling people with limited understanding of the code to blindly trust whatever ChatGPT tells them is bad advice.
- AnthonyVOOct 25, 2024Copper Contributor
The following is a link to a dialog with ChatGPT that comes to the same conclusions. For all the reasons that you mentioned, I would not trust ChatGPT to write code. It might be helpful for suggestions but expecting it to build anything trustworthy is a fool's errand.
http://www.dbfront.com/blog/post/2023-03-01-chatgpt-and-dbfront-handle-depreciation - bmercerJul 07, 2023Iron ContributorHow ChatGPT is different from a person:
1. ChatGPT has absolutely no knowledge or understanding of language syntax, set theory, data structures, indexes, etc.
2. ChatGPT cannot actually run a query against the DB and compare the output to expectations to confirm whether it's correct or not.
3. ChatGPT can create a query that looks perfect, but is wrong, and ChatGPT cannot tell that it is wrong.
4. ChatGPT can provide contradictory answers to the same question based solely on differences in phrasing the question.
ChatGPT is an impressive accomplishment and does amazing things, but it is not alive. It does not reason.
Regarding what the OP asked for, I see multiple helpful suggestions, and the OP has stated as much.
PowerApps, Sharepoint, and custom web apps with SQL Server have all been suggested. If Microsoft has another general purpose database platform, I've never heard of it.
The simplest way to get data out of Access and into a more reliable and performant platform is to keep the Access front-end and move the back end data to a SQL Server, and that suggestion was made. - DeanBabicJul 07, 2023Brass ContributorHow is that different to a person doing it?
I see no difference, except it does not bring a coffee. Or complain.
So here is an idea, upload MS Access and ask to covert it to a Web app!
Of course people would upload prod data, because they can.
I'm still waiting to see an actual advice for the OP's question. What I see is a lot of doubts, not actual experiences in doing it.
People are forgetting that Access app can be anything. Can be a rubbish app, or a top-notch!
But we just don't know that.
We are blind.
And yet, the reply from many is "it's complicated", "costs money and time", it's ugly, it does not address VBA...
The good advice in my books is this from Tom:
"Hence you start with a pilot project, and migrate a small percentage of the app. I probably would worry less about the data than the ability to create forms with identical functionality. "
POC is everything. If someone does not have a few hours to build the POC with no coding at all, that's a shame.
And yes, people do not care what are they are uploading. Only professionals do. - bmercerJul 06, 2023Iron ContributorThat's a good analogy. I sometimes use ChatGPT to create a skeleton of a script which I can then customize. It almost never gets it right the first time, but generally you can just keep saying "that doesn't work" and providing it any error messages, and it will keep apologizing and making changes until you get something usable. Seems like it usually takes three or four tries before it provides a usable example for me.
Then you have to actually fix it for your real environment. Because of course, nobody is providing actual production data to ChatGPT... I hope. - BrianB_WS1OJul 06, 2023Copper Contributor
@inda reminds me of using the macro recording tool in Excel or Word to write some VBA routine, and then adapting it for other use, such as running an automated step in Excel from an MS Access database. You still have to fix it up, but it does save a lot of typing to get you started.