Results 1 to 9 of 9

Thread: ADO

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    Unhappy

    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>





  2. #2

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    ++++

    Oh yea this is what it currently yeilds=>
    ----------------------------------------------
    Microsoft VBScript runtime error '800a000d'

    Type mismatch: 'Open'

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


    Thanks.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    Angry directory

    C:\Inetpub\wwwroot\cgi-bin\DEALER.mdb

    still does'nt work!

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    Question WHOA!

    Take it slow with me I'm a rookie!!!!!
    Replace what with what?

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169

    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

  8. #8

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    40

    Unhappy Provider

    How do I know who the provider is?
    I think that the provider is wrong...

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
  •  



Click Here to Expand Forum to Full Width