Ask a Question related to ASP Database, Design and Development.
-
Tim Midgett #1
deleting access database record
I am trying to write an asp page to delete a record from my access database. I have written the page to display the info but when I select the entry to be deleted I get the following error message:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/delete_entry.asp, line 20
Here is the code I am using:
<%
option Explicit
Dim adoCon
Dim rsDeleteEntry
Dim strSQL
Dim IngRecordNo
IngRecordNo = CLng(Request.QueryString("ID_no"))
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("ccalls.mdb")
Set rsDeleteEntry = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT calltable.* FROM calltable WHERE ID_no=" & IngRecordNo
rsDeleteEntry.LockType = 3
rsDeleteEntry.Open strSQL, adoCon
rsDeleteEntry.Delete
rsDeleteEntry.Close
Set DeleteEntry = Nothing
Set adoCon = Nothing
Response.Redirect "delete_select.asp"
%>
I think it has to do with the EOF but I am new to asp and a little lost. :)
Thanks Tim
-----------------------------
This message is posted by [url]http://Asp.ForumsZone.com[/url]
Tim Midgett Guest
-
deleting DNS record using dnscmd.exe
Hello, I want to delete a record "comwebcam.yahoo" from the zone "com" When typing - dnscmd localhost /recorddelete com comwebcam.yahoo A I... -
Deleting a Record.
Thanks for the Help on the other problems...all resolved. One last (hopefullly) problem I can't seem to get around for this program...why isn't... -
problems adding record to access database
Greetings I'm having problems adding records to an access database. What I want to do is very simple. Here is my code. __CODE_START__ dim... -
Trouble with database access: can't edit record, just view it
Hallo! I use DWMX 6.1 and use ASP VBSCRIPT files to access a MS Access 2000 database. Initially I was able to edit the records. Then I had to add... -
editing record in access database
I am trying to pull a record into a form and then edit it. (not working to well) Hoping someone can show me a better way than this: <% option... -
Tim Midgett #2
Re: deleting access database record
Yea still at it Ray :)
I will give it a try. I hope I understand enought to do what you
suggested. hehe (tough to teach a newbie)
Thanks Tim
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Tim Midgett Guest
-
Tim Midgett #3
Re: deleting access database record
Hey Ray thanks got it to work with the following:
<%
option Explicit
Dim adoCon
Dim rsDeleteEntry
Dim strSQL
Dim IngRecordNo
IngRecordNo = CLng(Request.QueryString("ID"))
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
Server.MapPath("ccalls.mdb")
adoCon.EXECUTE "DELETE FROM calltable WHERE ID_no=" & ingRecordNo
Set adoCon = Nothing
Response.Redirect "delete_select.asp"
%>
Thanks Tim
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Tim Midgett Guest
-
Ray at #4
Re: deleting access database record
Outstanding! Excellent job! Good feeling when something works for the
first time, isn't it? One suggestion. Add
adoCon.Close
before you set it to nothing.
Ray at work
"Tim Midgett" <tmidgett@unitedfidelity.com> wrote in message
news:%23XPG2IkRDHA.3768@tk2msftngp13.phx.gbl...> Hey Ray thanks got it to work with the following:
>
>
> <%
> option Explicit
> Dim adoCon
> Dim rsDeleteEntry
> Dim strSQL
> Dim IngRecordNo
>
> IngRecordNo = CLng(Request.QueryString("ID"))
>
> Set adoCon = Server.CreateObject("ADODB.Connection")
>
> adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" &
> Server.MapPath("ccalls.mdb")
>
> adoCon.EXECUTE "DELETE FROM calltable WHERE ID_no=" & ingRecordNo
>
> Set adoCon = Nothing
> Response.Redirect "delete_select.asp"
> %>
>
> Thanks Tim
>
> *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
Ray at Guest



Reply With Quote

