473,320 Members | 1,848 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,320 software developers and data experts.

SQL commands

Hello
why the heck is the update command working but the delete command
not. Apart this section in the select all is the same.

-----
Case cintUpdateMode
m_cmPlzOrt.EndCurrentEdit()
sPlzOrtSQL = "UPDATE tblPlzOrt SET fldPlz = @fldPlz,
fldOrtsBez = @fldOrtsBez WHERE fldOrtsNr = @fldOrtsNr;"
Dim cmDb As New OleDbCommand(sPlzOrtSQL, cnPlz)
cmDb.Parameters.Add("@fldPlz", OleDbType.BigInt, 10,"fldPlz")
cmDb.Parameters.Add("@fldOrtsBez", OleDbType.VarChar, 60, "fldOrtsBez")
cmDb.Parameters.Add("@fldOrtsNr", OleDbType.BigInt, 10, "fldOrtsNr")
daAdapPlzOrte.UpdateCommand = cmDb
Case cintDeleteMode
sPlzOrtSQL = "DELETE * FROM tblPlzOrt WHERE fldOrtsNr = @fldOrtsNr;"
Dim cmDb As New OleDbCommand(sPlzOrtSQL, cnPlz)
cmDb.Parameters.Add("@fldOrtsNr", OleDbType.BigInt, 10, "fldOrtsNr")
daAdapPlzOrte.DeleteCommand = cmDb
End Select
--------

Thanks and regards
Michael
Nov 21 '05 #1
2 1402
Michael,

What is the reason that this command in the update and not in the delete.
(I cannot see if it is needed because that is dependend from how you use
your data)

m_cmPlzOrt.EndCurrentEdit()

Cor

Nov 21 '05 #2
Hi,

Dont see anything that looks wrong with the command. I would add
the update and delete commands to the dataadapter when i create it. Dont
forget you have to call the dataadapters update method to get it to delete
the records from the database.

Ken
----------------
"Michael Sgier" <sg***@dplanet.ch> wrote in message
news:42**********************@news.sunrise.ch...
Hello
why the heck is the update command working but the delete command
not. Apart this section in the select all is the same.

-----
Case cintUpdateMode
m_cmPlzOrt.EndCurrentEdit()
sPlzOrtSQL = "UPDATE tblPlzOrt SET fldPlz = @fldPlz,
fldOrtsBez = @fldOrtsBez WHERE fldOrtsNr = @fldOrtsNr;"
Dim cmDb As New OleDbCommand(sPlzOrtSQL, cnPlz)
cmDb.Parameters.Add("@fldPlz", OleDbType.BigInt, 10,"fldPlz")
cmDb.Parameters.Add("@fldOrtsBez", OleDbType.VarChar, 60, "fldOrtsBez")
cmDb.Parameters.Add("@fldOrtsNr", OleDbType.BigInt, 10, "fldOrtsNr")
daAdapPlzOrte.UpdateCommand = cmDb
Case cintDeleteMode
sPlzOrtSQL = "DELETE * FROM tblPlzOrt WHERE fldOrtsNr = @fldOrtsNr;"
Dim cmDb As New OleDbCommand(sPlzOrtSQL, cnPlz)
cmDb.Parameters.Add("@fldOrtsNr", OleDbType.BigInt, 10, "fldOrtsNr")
daAdapPlzOrte.DeleteCommand = cmDb
End Select
--------

Thanks and regards
Michael
Nov 21 '05 #3

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

Similar topics

4
by: Mark Wilson CPU | last post by:
A colleague has written a prototype program in PHP, using a MySQL database. It's a relatively simple app, with a restricted set of mysql commands used (see below). The MySQL DB is being replaced...
12
by: Moosebumps | last post by:
So, after reading some messages about os.system, and looking at the popen stuff and trying it a bit, I still have not found a way to keep a command window open for several commands (on Windows...
4
by: Avi Kak | last post by:
Is there a Python function in any of the standard-distribution modules that does what the backticks do in Perl? I want to run an external command and I'd like its output to be captured directly...
2
by: timdoyle05 | last post by:
Hi, I have a question relating to how Unix commands can be issued from Python programs. Im am currently writing a large test script in python and I need this script to call three other separate...
2
by: Raquel | last post by:
Why can we not give db2 System commands (commands starting with 'db2' like db2ilist, db2look, db2move etc.) through the Command Center? It is so convenient to retrieve and change commands in the...
8
by: Joanna Carter [TeamB] | last post by:
Hi Folks I am just trying to get my head around whether I can use a single SQLConnection for the life of the application or whether I should create it only when needed. I want to create...
13
by: =?Utf-8?B?VmVybm9uIFBlcHBlcnM=?= | last post by:
I am using VS2005. I created a Windows Appication project. Inside the Server Explorer, I created a new SQLExpress database, and then created a new table. I added the rows, making my first row an...
6
by: Peted | last post by:
Hi wondering what is the best way to do this Need a user to click a button, that sends 3 or 4 string based commands via a TCP/ip socket link I can connect to the ip device no problems, am...
15
by: tmp123 | last post by:
Hello, Thanks for your time. We have very big files with python commands (more or less, 500000 commands each file). It is possible to execute them command by command, like if the commands...
1
by: Riccardo Maria Bianchi | last post by:
Hello! :) I'm trying to run shell commands both with os.system() and subprocess.Popen() class. But I can't run aliases or function defined in my .bashrc file, like in the login interactive...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.