473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1769

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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.