I have an MSAccess database that is updated by multiple users. I am searching for particular records. Sometimes the search works, and sometimes it errors out. I have been at this for a long time and I just can't figure it out. Does anyone have any suggestions? Here is my code:
___
sqlSearchQuery = "SELECT DishID, DishName, TypeID, UserID, RecipeText FROM Recipe WHERE DishName LIKE '%" & SearchTerm & "%' AND Private = False ORDER BY RecipeText, UserID ASC;"
Set SearchRS = Server.CreateOb ject("ADODB.Rec ordset")
SearchRS.Open sqlSearchQuery, conn, 3, 3
IF SearchRS.EOF = "True" THEN
SearchRS.close
set SearchRS = Nothing
NoResponses = "Yes"
'No dishes with 'SearchTerm' in the title.
ELSE
SearchArray = SearchRS.getRow s()
SearchRS.close
set SearchRS = nothing
END IF
___
The error happens at SearchArray = SearchRS.getRow s(), and it shows:
___
Microsoft JET Database Engine error '80004005'
Record is deleted.
/RecipeSearchFra me.asp, line 88
___
I don't know how the record could be deleted if I'm just calling it up right at that point (I made sure no one else was using the database at the same time.)
4 1780 CroCrew 564
Recognized Expert Contributor
Give this a try~ -
<%
-
sqlSearchQuery = "SELECT DishID, DishName, TypeID, UserID, RecipeText FROM Recipe WHERE DishName LIKE '%" & SearchTerm & "%' AND Private = False ORDER BY RecipeText, UserID ASC;"
-
-
Set adoCon = Server.CreateObject("ADODB.Connection")
-
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Relative path to your Access database")
-
-
Set SearchRS = Server.CreateObject("ADODB.Recordset")
-
SearchRS.Open sqlSearchQuery, adoCon
-
-
If (SearchRS.EOF) Then
-
NoResponses = "Yes"
-
Else
-
SearchArray = SearchRS.getRows(SearchRS.RecordCount, 0)
-
End If
-
-
SearchRS.close
-
set SearchRS = nothing
-
%>
-
-
Thank you for the quick response! However, I still get the same error.
I forgot to mention that it works without errors if nothing is found in the database. The error comes only sometimes when the search DOES pull responses from the database. I can do a SearchRS.record count instead of the getrows() without getting an error.
CroCrew 564
Recognized Expert Contributor
Take a look at this:
http://tutorials.aspfa q.com/8000xxxxx-errors/80004005-errors.html
It seems to have a few examples to try out to fix your problem.
Hope that it helps~
Thanks for the help. It appears that some of my data had been corrupted and that was what caused the error.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David |
last post by:
Hi,
I'd like to adapt the query below to select records only if the Title field
contains the string "Book" (as an example).
I'd also like to use a different variant of the query elsewhere to select
all records where the Title field does not contain the string "Book".
I know my question sounds dumb to many, but I haven't worked with .ASP in a
while, and don't know how to put "Contains" and "Doesn't contain" in a
|
by: David |
last post by:
Hi,
I want to do a query that displays duplicate records in the database based
on IP address. What syntax should I use in the WHERE********** bit please?
Thanks,
set rsData = con.execute("SELECT formtype, entrydate, ipaddress FROM
formdata WHERE ************ ORDER BY ipaddress")
arData = rsData.getrows
|
by: dmiller23462 |
last post by:
Somebody take a look and give me any suggestions? My brain is nuked...
Here's my deal....I have online submission forms on my intranet at
work here....I am appending to an Access DB with the input from all
HTML fields and then querying aforementioned DB with different
variables (search by name, wave, reason, etc). The output that I'm
getting (SELECT * 'cause I need all of the data included in the
search) I would like to display in a nice...
|
by: bajopalabra |
last post by:
hi
session("myVar") = rs.getRows( )
don't work when number of records
is greater than 10
does anybody know WHY ???
is it a Session object limitation ???
thanks
|
by: =?Utf-8?B?VmFuZXNzYQ==?= |
last post by:
Here is my loop and it runs fine:
----------------------------------------------------
sSQL = "SELECT * FROM STORE_ITEMS"
Set DataRec = DB.execute(sSQL)
if not DataRec.EOF then
do while not DataRec.EOF
SKU = trim (DataRec("SKU"))
ITEM_ID = trim(DataRec("ITEM_ID"))
...
| |
by: Eric Layman |
last post by:
Hi,
I have the following script below.
I intend to have a dynamic array of non fixed size
set rsseats = conn.execute("select * from seats")
Dim arr(1)
response.write ubound(arr)
do while not rsseats.eof
|
by: karen987 |
last post by:
I have a webpage called "topicview.asp" on a news website with ASP pages, it's a simple news publishing software. You add the news from the Admin section and all the details are stored in a database.
This page shows all the categories filtered out, (10 to a page) but it doesn't show the NAME of the category anywhere on the page. How can i add the name of the category? In the database the title of the secction that stores the
nm_tbl_cate...
|
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,...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
| |
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |