Sir
I m trying to add data to access database, but its prompting a error "
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'directory'
/opac/search/form_ac.asp, line 17"
asp code of this error is:
---------------------------------------------------------
<html>
<head>
</head>
<body>
<%
' Declaring variables
Dim title, description, keywords, url, mydate, data_source, con, sql_insert
' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
' Receiving values from directory
title = ChkString(Request.directory("title"))
description = ChkString(Request.directory("description"))
keywords = ChkString(Request.directory("keywords"))
url = ChkString(Request.directory("url"))
mydate = ChkString(Request.directory("mydate"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("directory.mdb")
sql_insert = "insert into all_pages (title, description, keywords, url, mydate) values ('" & _
title & "', '" & description & "', '" & keywords & "', '" & url & "', '" & mydate & "')"
' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
' Done. Close the connection
con.Close
Set con = Nothing
Response.Write "All records were successfully entered into the database."
%>
</body>
</html>
------------------------------------------------
please help to solve this problem
I m trying to add data to access database, but its prompting a error "
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'directory'
/opac/search/form_ac.asp, line 17"
asp code of this error is:
---------------------------------------------------------
<html>
<head>
</head>
<body>
<%
' Declaring variables
Dim title, description, keywords, url, mydate, data_source, con, sql_insert
' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function
' Receiving values from directory
title = ChkString(Request.directory("title"))
description = ChkString(Request.directory("description"))
keywords = ChkString(Request.directory("keywords"))
url = ChkString(Request.directory("url"))
mydate = ChkString(Request.directory("mydate"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("directory.mdb")
sql_insert = "insert into all_pages (title, description, keywords, url, mydate) values ('" & _
title & "', '" & description & "', '" & keywords & "', '" & url & "', '" & mydate & "')"
' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
' Done. Close the connection
con.Close
Set con = Nothing
Response.Write "All records were successfully entered into the database."
%>
</body>
</html>
------------------------------------------------
please help to solve this problem