473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Can't update a field from VB

GH
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

Jul 19 '05 #1
0 1176

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Epetruk | last post by:
Hi, I have a mySql question here on updates to multiple tables. Here's a simple schema to clarify things: Structure Table A
3
by: rrh | last post by:
I am trying to update a field in one table with data from another table. The problem I'm running into is I need to base the update on a range of data in the 2nd table. Table 1 has: date field...
9
by: James Butler | last post by:
Our setup: Online db: MySQL Inhouse db: MS Access 97 with MySQL tables linked via ODBC Our issue: Almost every field updates successfully, except one. A scenario: Information is written to...
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
13
by: nyt | last post by:
I have a problem of number and text field. I got the database file(mdb) that contains many combo boxes used and its list values are created by "value list" For eg field Field name= 'furniture'...
4
by: Kannan s | last post by:
Dear Sir, Sub: help requred to build an Update Query using if or iif I am having two tables with the following fields I wish to create a single update query in MS Access Table1: code,...
8
by: Stephen Plotnick | last post by:
I have three forms and update one table in an Access DB with sucess in one form. In the other two forms I'm trying to do an update to a different table in the Access DB. The error I'm getting...
7
by: rpeacock | last post by:
I was curious to know if it is possible to run an Update query by passing the field name as a variable for updating. The simple example should make more sense. Basically I am trying to change the...
2
by: John Kotuby | last post by:
Hi all, Maybe this belongs in the Full Text group but I am writing an ASP.NET application with a SQL Server 2005 backend, so I am posing the question here. I have been using fulltext search...
4
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.