473,791 Members | 3,071 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript to delete a record in SQL server

i wish to make use of javascript to delete a record by clicking a button,
what's wrong with the following 3 lines? Thanks a lot.

function confirmYes()
{
var adoConnection = Server.CreateOb ject("ADODB.Con nection");
adoConnection.O pen("driver={SQ L
Server};Server= ABCD;Database=A AA;UID=BBB;PWD= CCC");
adoConnection.E xecute("update dbo.out set Schedule_Time = null where out_id
=<%=oMyObject%> ;");
}
Sep 21 '06 #1
1 4873
Could be any number of things:
1. security on client machine
2. ODBC set up on client machine
3. Server side code mixed in with client-side: have you debugged what
<%=oMyObject%wr ites
3. are the DB objects ok?

Are you sure you want to evoke this code on the client?

Nic

Tony WONG wrote:
i wish to make use of javascript to delete a record by clicking a button,
what's wrong with the following 3 lines? Thanks a lot.

function confirmYes()
{
var adoConnection = Server.CreateOb ject("ADODB.Con nection");
adoConnection.O pen("driver={SQ L
Server};Server= ABCD;Database=A AA;UID=BBB;PWD= CCC");
adoConnection.E xecute("update dbo.out set Schedule_Time = null where out_id
=<%=oMyObject%> ;");
}
Sep 21 '06 #2

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

Similar topics

3
1895
by: JWM | last post by:
Hello: Here is what I am trying to do...... The user clicks on the delete icon, and gets a JavaScript client-side popup to confirm that he wants to delete. I am passing this client-side function a contactID. Then, I want to send the result of this confirm (true|false) to a server-side VBScript function, along with the contactID. The VBScript function will then perform a delete in the database for the specified contactID.
6
2264
by: Jim Heavey | last post by:
Hello, hopefully this is a simple question.. I have the following statemen <asp:Button ID="cmdPPIPDelete" Text="Delete" Runat="server" CssClass="buttonDelete" CommandName="Delete" OnClick="return confirm('Please Confirm You Want To Delete Record')"></asp:Button Each time I navigate to this page, I get a compile error of "CS1041 Identifier expected, return is a keyword" Iif I take out the javascript, then I have no errors when I...
1
1425
by: Prabhat | last post by:
Hi All, Sorry that I am Asking this question in this Group. I have one doubt in SQL Server, Regarding how DELETE Works? What is the Actual Thing that SQL Server Do when we delete any record from the Database Table? Does it maintain any Falg Internally or actually Delete the Record from Database?
0
899
by: JackO | last post by:
I am experiencing the following error: Compiler Error Message: BC30205: End of statement expected. Source Error: Line 5: <title>UpdateVendor</title> Line 6: <script runat="server"> Line 7: public void Page_Load(Object sender, EventArgs E) {
0
1180
by: news.microsoft.com | last post by:
I am going crazy trying to figure this out, and I am wondering if this is a bug in the ASP.Net implementation. My situation: I have an ASPX page with 2 different modes: *Mode 1: Datagrid with no footer *Mode 2: Datagrid with a footer template containing a textbox and an "Add Record" command (also has an edit column)
0
1189
by: Chris S | last post by:
I am going crazy trying to figure this out, and I am wondering if this is a bug in the ASP.Net 1.1 implementation. My situation: I have an ASPX page with 2 different modes: *Mode 1: Datagrid with no footer *Mode 2: Datagrid with a footer template containing a textbox and an "Add Record" command (also has an edit column)
6
3859
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called "Generations"), and it allows the user to add, edit and delete the various records of the table. "Generations" table has the following fields: "IDPerson", NamePerson", "AgePerson" and "IDParent". A record contains the information about a person (his name, his...
14
18233
by: darrel | last post by:
Is it possible to pre-empt the javascript function used to do a postback from a linkbutton? I'd like to use linkbutton to delete a record and want to add a confirmation box via javascript "are you sure you want to delete this record?" before it executes the postback. The javascript is straightforward for this, but have no idea how to have that intercept the post-back script. -Darrel
5
3945
by: sh26 | last post by:
I can Add and Delete (A, CName, MX and TXT) Dns records on the Dns Server using C# code. The problem I am having is if someone manaully creates a TXT record on the Dns Server, I cannot delete that particular record using the same C# code. Here is what I am using to delete the records: public void DeleteRecord(string domain, string recordName, string recordType, string recordData) { try { ...
0
9669
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
9515
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10427
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
10207
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
9029
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...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
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.