Results 1 to 6 of 6

Thread: '.jet' and ASP

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    Newark-on-trent, Nottingham
    Posts
    243

    '.jet' and ASP

    Is it possible to open a .jet database in ASP? If so how i have searched the web for information on opening a '.jet' database and all i am getting is errors when opening a '.mdb'.

    Thanks in advance

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Post your code that you are using...

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    Newark-on-trent, Nottingham
    Posts
    243

    No code...

    There is no code as yet just a database file called 'advertiser.jet' and i am wnting to open the '.jet' file with ASP

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    .jet file extension um is there an actual filetype of that? Is it an mdb mascarading as .jet?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    Newark-on-trent, Nottingham
    Posts
    243
    okay it is an access mdb but the application that uses it requires that it has a .jet extension i have mastered the opening of the database connection in ASP but for some reason it will only bring back results from a table and not a query.

    My code is as follows:

    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open "c:\inetpub\wwwroot\doors\fpdb\advertiser.jet"
    set rs=Server.CreateObject("ADODB.recordset")
    rs.Open "Select * from Users", conn
    rs.movefirst
    do while rs.eof=false
    response.write rs("Surname")
    rs.movenext
    loop
    rs.close
    conn.close
    %

    names is the name of my access query. As i said before it has now problems if i select * form a table in the database but it will not work with a query. The error we get is:

    Error Type:
    (0x80004005)
    Unspecified error

    Your help is greatly appreciated as i am pulling my hair out on this one!!! : (

  6. #6
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    Firstly add ,3,3,1 to the rst.open "sql statement", conn

    VB Code:
    1. rs.Open "Select * from [Users]", conn, 3, 3, 1 'This is read only (static)

    Then remark out the rest of the code:
    VB Code:
    1. 'rs.movefirst
    2. 'do while rs.eof=false
    3. 'response.write rs("Surname")
    4. 'rs.movenext
    5. 'loop
    6.  
    7. rs.close
    8. conn.close

    If there is no errors now, then it has to be that you are trying to move to the first record but for some reason there are no records returned.
    VB Code:
    1. if rst.eof then
    2.     response.write("No records - sorry")
    3. else
    4.     rs.movefirst
    5.     do while rs.eof=false
    6.         response.write rs("Surname")
    7.         rs.movenext
    8.     loop
    9. end if

    Also add square brackets around your field and table names, just incase they happen to be special functions.


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

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