Ask a Question related to ASP Database, Design and Development.
-
Geoff Wickens #1
more on database handling
Many thanks to all who have given so much advice already. This is much
appreciated and I have now got my system sort of working. I am having more
trouble with deleting a record from my database.
I want to be able to select the event in a form and then collect this and
use it in my delete statement as below.
<%
d = Request.Form("eventid")
Set Catalog=Server.CreateObject("ADODB.Recordset")
Catalog.open "DELETE * FROM tblbookings WHERE eventID = d", "DSN=calendar"
Set Catalog=Nothing
%>
I realise that this is probably not the best method of doing this, but is
there a way to do this. My delete statement doesn't seem to recognise the d
as a variable.
Geoff Wickens
Geoff Wickens Guest
-
Client variable database repository exception handling
We have recently had 2 incidents where client variable database storage appears to have failed in our clustered environment. We have 2 servers that... -
Handling multiple database server instances - failover
Hi all, I have a oracle tnsentry like this. It has multiple failover instances for the oracle database. TESTSID = (DESCRIPTION =... -
NEWBIE HELP Import Data from flat-database to relational-database
I want to import Data from a simple Database, which contains all Information in one big record into a relational Database and split up the big... -
Passing database info to page allow user input then pass into another database
Hi I really am going crazy! I'm using VBScript, ASP, and SQL My page reminds me of a shopping cart but looking at shopping cart examples has not... -
Another user has modified the contents of this table or view; the database row you are modifying no longer exists in the database;
Hi, I am testing a trigger that and I am getting this error message saying "Another user has modified the contents of this table or view; the... -
Ray at #2
Re: more on database handling
1. Don't create a recordset when deleting.
2. Don't do "delete * from." Just do "delete from."
3. Don't use a DSN unless you absolutely must.
4. Your SQL string should look like:
sSQL = "DELETE FROM [tblBookings] WHERE [EventID]=" & CStr(d)
Ray at work
"Geoff Wickens" <gwickens@hotmail.com> wrote in message
news:nlp2b.5384$tS2.3514764@newsfep2-win.server.ntli.net...d> Many thanks to all who have given so much advice already. This is much
> appreciated and I have now got my system sort of working. I am having more
> trouble with deleting a record from my database.
>
> I want to be able to select the event in a form and then collect this and
> use it in my delete statement as below.
>
> <%
> d = Request.Form("eventid")
>
> Set Catalog=Server.CreateObject("ADODB.Recordset")
>
> Catalog.open "DELETE * FROM tblbookings WHERE eventID = d", "DSN=calendar"
>
>
> Set Catalog=Nothing
> %>
>
> I realise that this is probably not the best method of doing this, but is
> there a way to do this. My delete statement doesn't seem to recognise the> as a variable.
>
> Geoff Wickens
>
>
Ray at Guest
-
Bob Barrows #3
Re: more on database handling
Ray at <%=sLocation%> wrote:
With Jet, you need the *.> 1. Don't create a recordset when deleting.
> 2. Don't do "delete * from." Just do "delete from."
Bob
Bob Barrows Guest
-
Ray at #4
Re: more on database handling
Really? I don't. ?
Dim oADO
Set oADO = CreateObject("ADODB.Connection")
oADO.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;"
oADO.Execute "delete from table1"
oADO.Close
Set oADO = Nothing
That works for me. ?
Ray at work
"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:u2m8bz1aDHA.2412@TK2MSFTNGP10.phx.gbl...> Ray at <%=sLocation%> wrote:>> > 1. Don't create a recordset when deleting.
> > 2. Don't do "delete * from." Just do "delete from."
> With Jet, you need the *.
>
> Bob
>
>
Ray at Guest
-
Bob Barrows #5
Re: more on database handling
Hmm - must have changed with Jet 4.0. I know I used to have to use it with
A97 ...
Bob
Ray at <%=sLocation%> wrote:> Really? I don't. ?
>
> Dim oADO
> Set oADO = CreateObject("ADODB.Connection")
> oADO.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;"
> oADO.Execute "delete from table1"
> oADO.Close
> Set oADO = Nothing
>
> That works for me. ?
>
> Ray at work
>
>
> "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> news:u2m8bz1aDHA.2412@TK2MSFTNGP10.phx.gbl...>> Ray at <%=sLocation%> wrote:>>>>> 1. Don't create a recordset when deleting.
>>> 2. Don't do "delete * from." Just do "delete from."
>> With Jet, you need the *.
>>
>> Bob
Bob Barrows Guest
-
Ray at #6
Re: more on database handling
So then it's something from before my time, I guess. I didn't even own a
computer when Access 97 was out. :P
Ray at work
"Bob Barrows" <reb_01501@yahoo.com> wrote in message
news:u8%231cK9aDHA.2296@TK2MSFTNGP09.phx.gbl...> Hmm - must have changed with Jet 4.0. I know I used to have to use it with
> A97 ...
>
> Bob
> Ray at <%=sLocation%> wrote:>> > Really? I don't. ?
> >
> > Dim oADO
> > Set oADO = CreateObject("ADODB.Connection")
> > oADO.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;"
> > oADO.Execute "delete from table1"
> > oADO.Close
> > Set oADO = Nothing
> >
> > That works for me. ?
> >
> > Ray at work
> >
> >
> > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
> > news:u2m8bz1aDHA.2412@TK2MSFTNGP10.phx.gbl...> >> Ray at <%=sLocation%> wrote:
> >>> 1. Don't create a recordset when deleting.
> >>> 2. Don't do "delete * from." Just do "delete from."
> >>
> >> With Jet, you need the *.
> >>
> >> Bob
>
Ray at Guest



Reply With Quote

