2012-07-15 192 views
1

我想創建第一找不到可安裝ISAM

<form id="form1" name="form1" method="get" action="mySearchResults.asp"> 
    <label>Enter Keywords:` 
    <input type="text" name="searchTerm" />` 
    </label>` 
    <p> 
    <input type="submit" name="Submit" value="Submit" /> 
    </p> 
</form> 

然後

<% 
'open the connection 
Dim Connect, myRecordSet 
Set Connect = Server.CreateObject("ADODB.Connection") 
Connect.Open = "Provider=Microsoft.Jet.OLEDB.4.0;Database='SVCS.mdb'" 
%> 

<% 
'collect the form input 
searchInput = Request.QueryString("searchTerm")` 

'check for a match 
Set myRecordSet = Connect.Execute ("SELECT * FROM Inventory WHERE myColumn LIKE '%" & searchInput & "%'") 


'display the results 
if myRecordSet.EOF then 
response.write("You searched for: " & searchInput & "<br>") 
response.write("A match was not found.<br>Sorry try again.") 
else 
response.write("You searched for: " & searchInput & "<br>") 
response.write("The record was found!<br>The match is: " & myRecordSet("myColumn")) 
end if 
%> 
<br><br> 
<a href="mySearchForm.asp">Try Again</a> 

在我的網頁搜索功能和錯誤是

Microsoft JET Database Engine error '80004005' 
Could not find installable ISAM. 
/sarah lee video club website/mySearchResults.asp, line 5 

請告訴我如何解決此問題

+0

請參見您可以使用代碼按鈕'{}'格式化你的代碼。 – Fionnuala 2012-07-15 19:23:53

回答

0

Yo你不應該引用數據庫名稱的一個問題,它是數據源,而不是數據庫,並且你不需要與Open相等。

Set con = Server.CreateObject("ADODB.Connection") 
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=SVCS.mdb" 

http://connectionstrings.com

相關問題