473,385 Members | 2,243 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 program

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 1907

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

Similar topics

0
by: Jim S. | last post by:
I'm having a horrible time simply inserting the date in a MySQL database through a Visual Basic program. I have a table, called "ORDERS"; "ID" is the primary key. I'm trying the insert the date,...
0
by: GH | last post by:
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...
0
by: GH | last post by:
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...
7
by: Steve B. | last post by:
Does anyone know why the DA Update() would throw an exception? I moved the database but I updated the Conn and the DA, currently (trying)removing/replacing DS. Is there a another direction I...
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...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
8
by: mlwerth | last post by:
Dear Access Group: This is the most basic and most embarrassing of questions, but I cannot find where to change the data type of a text field that I have in Access 2003 to a number field. I've...
2
by: Steve | last post by:
Hi All I have several POS programs (Windows forms VS 2005) Some customers have multiple copies of the programs, all networked to the 1 SQL Server 2005 Database which resides on 1 of the...
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...
4
by: Salad | last post by:
I have a situation where some, not all, users get the message "Couldn't find file "F:\AccessApps\AppName.mdw". This file is required for startup". My app the users are attempting to access is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.