PDA

Click to See Complete Forum and Search --> : ADO


spg1
Aug 29th, 2000, 02:41 PM
I am trying to make a search button feature. I have 1 commmand button and one text box. I need to use the text box in order to perform a search in my database. The button s going to initiate the search. How Do I create something like that? I need Help, Here is What I have=>
my database is DEALER.mdb and my table is table 1 which contains two fields : F1,F2....When F1 is entered in the text box, F2 should be the result displayed. I am real new to this so I would greatly appreciate all help and code :}
------------------------------------------------------
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<TITLE>Untitled</TITLE>
</HEAD>
<BODY><%
set con = Server.CreateObject("DEALER.Connection")
constr = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=http://georgen/DEALER.mdb;"
con.open constr
set rs = con.Execute("SELECT * FROM Table 1")
%>
<P>
<FORM method="GET" action="zip.asp">&nbsp;
<P><B>Enter a Zip-Code: </B><INPUT name=zip size="5" type="text"> <INPUT type=submit value="look it up"> </FORM>
<BLOCKQUOTE></BLOCKQUOTE></TD><TD width="14" valign="top"><IMG height=1 src=""
width=14> </TD></TR><TD colspan="4">&nbsp;
<HR noShade SIZE=1>
<%
Value = Request.Querystring("zip")
</BODY>
</HTML>

spg1
Aug 29th, 2000, 02:43 PM
Oh yea this is what it currently yeilds=>
----------------------------------------------
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'Open'

/test2.asp, line 9
----------------


Thanks.

parksie
Aug 29th, 2000, 02:44 PM
It can't access databases in the form http://server/file.mdb
If it's on your server, just use "c:\website\cgi-bin\data.mdb", or similar. Just make sure that your database is in a non-published folder.

spg1
Aug 29th, 2000, 02:56 PM
C:\Inetpub\wwwroot\cgi-bin\DEALER.mdb

still does'nt work!

parksie
Aug 29th, 2000, 03:01 PM
It's a type mismatch - try not using an extra string to store the connection info (go con.open "...").

spg1
Aug 29th, 2000, 03:13 PM
Take it slow with me I'm a rookie!!!!!
Replace what with what?

parksie
Aug 29th, 2000, 03:17 PM
Instead of:

constr = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=c:\dealer.mdb;"
con.open constr

use:

con.open "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=c:\dealer.mdb;"


Actually, though, I think you need to specify an actual data source (.dsn) file for this. The easiest way, if you're using an Access database, is to use DAO:

Dim DB
Dim rst

Set DB = OpenDatabase("dealer.mdb")
Set rst = DB.TableDefs("Dealers").OpenRecordset

...and so on.

spg1
Aug 29th, 2000, 04:09 PM
How do I know who the provider is?
I think that the provider is wrong...

parksie
Aug 29th, 2000, 05:02 PM
It depends. What version of Access are you using? 2000 uses Jet 4.0