473,799 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

use db-lib to update database records

How to use db-lib to update/insert database records without using SQL
language. I want to change the value of the data individually without
plugging in the new values in the SQL language then execute it. The
perfect situation for me is loop through the retrieved records then
edit the values individually until EOF.

Thanks,

Carlo
Jul 20 '05 #1
1 1509
Carlo Chung (ca********@hot mail.com) writes:
How to use db-lib to update/insert database records without using SQL
language. I want to change the value of the data individually without
plugging in the new values in the SQL language then execute it. The
perfect situation for me is loop through the retrieved records then
edit the values individually until EOF.


It is possible that you can use the dbcursor functions for this, but
I have never tried these functions myself. I am very much in favour
using explicit SQL statement for my updates, so that I know what is
going on.

Also, depending what edits you are about to make, you may win
magnitudes in performance by updating all rows in one statement. Only
use one-by-one processing when absolutely necessary.

There is also a sad tale to tell about DB-Library: Microsoft has deprecated
this fine library, and have not enhanced it since the release of 6.5.
Unless you are working with a legacy application, don't use DB-Library
for development.

If you are dead set on doing updates without SQL statements, you should
use ADO or ADO .Net.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

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

Similar topics

3
1992
by: Bruno Baguette | last post by:
Hello, I've a strange problem using PEAR::DB (even with the latest version). Our PHP version is 4.3.4. The above line stop the PHP script execution or crashes PHP (I don't know exactly) when the script is runned throught the browser (so, via Apache) : $db = DB::connect(DATASOURCE);
0
1364
by: Derek Battams | last post by:
With PHP5RC2, DB::connect() is not returning the correct type of object. #!/usr/local/bin/php <?php require_once("DB.php"); $dsn = "odbc://db2inst1:badpasswd@testdb"; $db = DB::connect($dsn); echo $db->getMessage(); if(DB::isError($db))
2
2564
by: Oliver Peek | last post by:
Hi all, Probably my fault, I'm opening a Berkeley DB file, iterating through and deleting keys, well making an attempt. I get this error when I try to delete. ---error Traceback (most recent call last): File "./db.py", line 41, in ?
13
1971
by: Arno R | last post by:
Hi all In another thread I had problems changing db.props Another problem I encountered while testing this: db corrupt When I deleted db.props through code in a loop I could not start the db again ... @#$%$ Warning: Don't just try following code on any existing db. Make sure there is a copy! (I did ...) To test I created a NEW db in A2000 and just set some properties (menu StartUpOptions) Props like: AppTitle, StartUpForm,...
26
6282
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on the shared_buffers setting. I invite any corrective or confirming feedback. I realize there are many other hugely important performance factors outside this scope. One key aspect of pgsql performance tuning is to adjust the memory ...
8
23482
by: Challenge | last post by:
Hi, I got error, SQL1768N Unable to start HADR. Reason code = "7", when I tried to start hadr primary database. Here are the hadr configuration of my primary db: HADR database role = STANDARD HADR local host name (HADR_LOCAL_HOST) = testserver HADR local service name (HADR_LOCAL_SVC) = 56000 HADR remote host name (HADR_REMOTE_HOST) = testserver
2
7419
by: Venkata Narayana | last post by:
Hi, You all may be knowing that Connection.isClosed() does not tells us if the underying DB connection is active or not; it only checks if Connection.close() had been previously called or not. One sure shot way to find out this is by executing some dummy SELECT query and catching it via SQLException. This could be done in various DB's as follows: SELECT * from 1 (MS SQL) SELECT * from DUAL(Oracle)
3
2715
by: Iain King | last post by:
I'm manipulating an MS Access db via ADODB with win32com.client. I want to rename a field within a table, but I don't know how to. I assume there is a line of SQL which will do it, but nothing I've tried (from searching) has worked. Basic code: import win32com.client connection = win32com.client.Dispatch(r'ADODB.Connection') DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=dbfile.mdb;' connection.Open(DSN)
20
5625
by: Author | last post by:
a .net 1.1 app has a class whose constructor opens a db connection to sql svr two thousand. this class has more than a dozen of methods. most of them don't do db stuff. I am wondering if this design is going to be a problem, bcoz each time this class is instantiated, a db conn is open. The worst thing is that I haven't seen anywhere in the code the db conn is closed. I write about this bcoz I see that this app leaves more than one...
3
3034
by: akdemirc | last post by:
i have a problem with large data import to a db in sql server.. Actually i have an application that collects data from an environment and dispatches this data to different csv files for sql server to bulk insert.. Each csv file corresponds a table in db.. After generating csv files on the application server(as a result csv files are remote files for the sql server), the dump process takes so much time that sometimes causes transaction log to...
0
9689
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10269
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9085
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7573
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5597
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.