I had created a file called as openconn.asp to create connections.I am including that page in every page so that I dont have to write code for connection in every page. IT is opening Connection correctly. in index.asp page i have opened a recordset. But recordset is throwing error. If i give only table name it says "Invali sql Statement" and something that it needs valid sql query like Insert, Update, Delete or Select. SO I had created a sekect SQL query as "Select * from Usr", but now it shows error messege -
Microsoft JET Database Engine error '80040e37' or -2147217865
The Microsoft Jet database engine cannot find the input table or query 'Usr'. Make sure it exists and that its name is spelled correctly.
/ya/Index.asp, line 25
I am enclosing the code for both openconn.asp and Index.asp pages. One more thing I had asked web server admin to give write privileges on directory Database. So that the fil is also not read only. Also I have removed Object tags and using ADO connection string as suggested by you. Now why is this new error coming up.
Can you please help me to solve this.
Thanks And Regards
Rajiv
Code in Index.asp
*******************************
<%@ Language=VBScript %>
<!--#include file="openconn.asp" -->
<html>
<head>
<title> Patient History System </title>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>
<%
Dim uid,pwd
uid = Request.Form ("userid"
pwd = Request.Form ("password"
IF Rs.STATE = 1 THEN
Rs.CLOSE()
END IF
Rs.ActiveConnection = dbObj
Rs.CursorType = adOpenKeySet
Rs.LockType = adLockOptimistic
Rs.Source = "select * from usr"',dbobj,3,1
Rs.Open
Response.Write "RS Stare" & RS.State
*******************************
Code in Connopen.asp
*******************************
<%'connection to admin.mdb
Dim dbObj, RS, RSOther
set dbObj = server.createobject("ADODB.connection"
set RS = server.createobject("ADODB.Recordset"
set RSOther = server.createobject("ADODB.Recordset"
curdir= server.mappath("/jurix/database/admin.mdb"
set dbobj = server.CreateObject("ADODB.Connection"
dbObj.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & curdir &";Persist Security Info=False"
%>
******************************************
Microsoft JET Database Engine error '80040e37' or -2147217865
The Microsoft Jet database engine cannot find the input table or query 'Usr'. Make sure it exists and that its name is spelled correctly.
/ya/Index.asp, line 25
I am enclosing the code for both openconn.asp and Index.asp pages. One more thing I had asked web server admin to give write privileges on directory Database. So that the fil is also not read only. Also I have removed Object tags and using ADO connection string as suggested by you. Now why is this new error coming up.
Can you please help me to solve this.
Thanks And Regards
Rajiv
Code in Index.asp
*******************************
<%@ Language=VBScript %>
<!--#include file="openconn.asp" -->
<html>
<head>
<title> Patient History System </title>
<meta NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</head>
<%
Dim uid,pwd
uid = Request.Form ("userid"
pwd = Request.Form ("password"
IF Rs.STATE = 1 THEN
Rs.CLOSE()
END IF
Rs.ActiveConnection = dbObj
Rs.CursorType = adOpenKeySet
Rs.LockType = adLockOptimistic
Rs.Source = "select * from usr"',dbobj,3,1
Rs.Open
Response.Write "RS Stare" & RS.State
*******************************
Code in Connopen.asp
*******************************
<%'connection to admin.mdb
Dim dbObj, RS, RSOther
set dbObj = server.createobject("ADODB.connection"
set RS = server.createobject("ADODB.Recordset"
set RSOther = server.createobject("ADODB.Recordset"
curdir= server.mappath("/jurix/database/admin.mdb"
set dbobj = server.CreateObject("ADODB.Connection"
dbObj.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & curdir &";Persist Security Info=False"
%>
******************************************