Hi,
I've just setup MySQL on a Linux machine and I'm using Visual Basic in
Windows to connect to it (using MySQL ODBC 3.51 driver). Everything works
fine for browsing the database (used for stock control), but some parts of
the VB program refuse to update the database. It was using an Access
database (which worked ok) and I'm using the same SQL statement and table
structure.
Here's the SQL statement that VB runs:
SELECT Stock.GJGStockCode, Stock.PartName, Stock.Discontinued,
Stock.UnitsInStock, Stock.UnitsOnOrder, Stock.ReorderLevel,
Stock.ReorderQty, StockSuppliers.SupplierID,
StockSuppliers.OrderCode, StockSuppliers.PackQty,
StockSuppliers.Price, Stock.PartsToOrder
FROM Stock, StockSuppliers
WHERE Stock.CurrentSupplier = StockSuppliers.Position AND
Stock.GJGStockCode = StockSuppliers.GJGStockCode AND
((Stock.UnitsInStock + Stock.UnitsOnOrder <= Stock.ReorderLevel)
OR
(Stock.PartsToOrder > 0))
ORDER BY StockSuppliers.SupplierID, Stock.GJGStockCode
....which works ok for browsing the database. If I change the
Stock.PartsToOrder field in the VB program, when VB trys to update it I get
the error message "Insufficient key column information for updating or
refreshing". The Stock table has a primary key (GJGStockCode), and the
StockSuppliers table has a primary key (UniqueID) which is an auto_increment
bigint.
Does anybody know what I need to do to allow VB to update the database? Or
is this a VB question!?? - Although the same SQL statement works with an
Access database.
Thanks in advance for any help.
Gareth