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

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.CreateObject("ADODB.Connection");
adoConnection.Open("driver={SQL
Server};Server=ABCD;Database=AAA;UID=BBB;PWD=CCC") ;
adoConnection.Execute("update dbo.out set Schedule_Time = null where out_id
=<%=oMyObject%>;");
}
Sep 21 '06 #1
1 4849
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%writes
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.CreateObject("ADODB.Connection");
adoConnection.Open("driver={SQL
Server};Server=ABCD;Database=AAA;UID=BBB;PWD=CCC") ;
adoConnection.Execute("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
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...
6
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...
1
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...
0
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">...
0
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...
0
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:...
6
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...
14
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...
5
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...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...
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...

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.