|
Thread: ADO
-
Aug 29th, 2000, 02:41 PM
#1
Thread Starter
Member
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">
<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">
<HR noShade SIZE=1>
<%
Value = Request.Querystring("zip")
</BODY>
</HTML>
-
Aug 29th, 2000, 02:43 PM
#2
Thread Starter
Member
++++
Oh yea this is what it currently yeilds=>
----------------------------------------------
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'Open'
/test2.asp, line 9
----------------
Thanks.
-
Aug 29th, 2000, 02:44 PM
#3
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 29th, 2000, 02:56 PM
#4
Thread Starter
Member
directory
C:\Inetpub\wwwroot\cgi-bin\DEALER.mdb
still does'nt work!
-
Aug 29th, 2000, 03:01 PM
#5
Monday Morning Lunatic
It's a type mismatch - try not using an extra string to store the connection info (go con.open "...").
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 29th, 2000, 03:13 PM
#6
Thread Starter
Member
WHOA!
Take it slow with me I'm a rookie!!!!!
Replace what with what?
-
Aug 29th, 2000, 03:17 PM
#7
Monday Morning Lunatic
Sorry...
Instead of:
Code:
constr = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=c:\dealer.mdb;"
con.open constr
use:
Code:
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:
Code:
Dim DB
Dim rst
Set DB = OpenDatabase("dealer.mdb")
Set rst = DB.TableDefs("Dealers").OpenRecordset
...and so on.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 29th, 2000, 04:09 PM
#8
Thread Starter
Member
Provider
How do I know who the provider is?
I think that the provider is wrong...
-
Aug 29th, 2000, 05:02 PM
#9
Monday Morning Lunatic
It depends. What version of Access are you using? 2000 uses Jet 4.0
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|