I want to read some data from a dbase file and this is how my code looks
like
<%
Dim strSQLStreets
Dim strSQLTown
Dim cnRIS
Dim rsLookupStreets
Dim rsLookupTown
' The form links back to this same file passing back the id
%>
<p>
Pick a street:
</p>
<%
' Create ADO data connection object
Set cnRIS = Server.CreateObject("ADODB.Connection")
' Open data connection - Our SQL Server code
cnRIS.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\temp; Extended
Properties=DBase III;"
' Build our query for select box 1
'strSQLStreets = "SELECT Code, Description FROM ris_Lookup_Streets ORDER BY
Description;"
strSQLStreets = "SELECT FNODE, ADDRESS FROM rdcent WHERE Not ISNull(ADDRESS)
GROUP BY ADDRESS ORDER By Address"
' Create and open recordset object using existing connection
Set rsLookupStreets = Server.CreateObject("ADODB.Recordset")
rsLookupStreets.Open strSQLStreets, cnRIS
' Build our drop down box of salesmen names
If Not rsLookupStreets.EOF Then
'Streets
rsLookupStreets.MoveFirst
%>
<select name="Street" size="1">
<option></option>
<% ' Loop through Street
Do While Not rsLookupStreets.EOF
Response.Write "<option value="""
Response.Write rsLookupStreets.Fields("FNODE")
Response.Write """"
Response.Write "<Option>"
Response.Write
RTrim(rsLookupStreets.Fields("ADDRESS"))
Response.Write "</option>" & vbCrLf
' Move to next record
rsLookupStreets.MoveNext
Loop
End If
' Close ADO objects we're finished with and free DB variables
rsLookupStreets.Close
Set rsLookupStreets = Nothing
' Close ADO objects we're finished with and free DB variables
cnRIS.Close
Set cnRIS = Nothing
%>
I've tested the above connection using Visual Basic and it is working, but I
am getting the following error when doing it with ASP
Microsoft JET Database Engine error '80040e37'
The Microsoft Jet database engine could not find the object 'rdcent'. Make
sure the object exists and that you spell its name and the path name
correctly.
/mj/StreetsLookupDBase.asp, line 28
If anyone have some suggestions.
Thanks
Mariki Jovner
Palmerston North City Council
Tel. (06) 356 8199 X 7355
Fax (06) 351 4412
Web site: www.pncc.govt.nz
__________________________________________________________________________________________
Caution: The content of this email is confidential and may be legally privileged. If it is not intended for you, please email the
sender immediately and destroy the original message. You may not copy, disclose or use the contents in any way. Thank You.
__________________________________________________________________________________________