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
Printable View
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
Post your code that you are using...
There is no code as yet just a database file called 'advertiser.jet' and i am wnting to open the '.jet' file with ASP
.jet file extension :confused: um is there an actual filetype of that? Is it an mdb mascarading as .jet?
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!!! : (
Firstly add ,3,3,1 to the rst.open "sql statement", conn
VB Code:
rs.Open "Select * from [Users]", conn, 3, 3, 1 'This is read only (static)
Then remark out the rest of the code:
VB Code:
'rs.movefirst 'do while rs.eof=false 'response.write rs("Surname") 'rs.movenext 'loop rs.close 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:
if rst.eof then response.write("No records - sorry") else rs.movefirst do while rs.eof=false response.write rs("Surname") rs.movenext loop end if
Also add square brackets around your field and table names, just incase they happen to be special functions.
Vince