?
Solved

Microsoft VBScript runtime error '800a01a8'  Object required: ''  -I can't find where

Posted on 2003-03-08
10
Medium Priority
?
448 Views
Last Modified: 2012-06-21
Someone had been helping me here w/ connection to a database and we finally got that working, I took the code and made a copy where I altered the names a bit. Anyway, I'm getting this error ***SEE TITLE*** and I can't find where. Below is the code in question
<%@LANGUAGE="VBSCRIPT"%>
<form method="POST" action="add2.asp">
 <p>Enter the <b>AREA TO INPUT TO<br>
   <select size="1" name="area">
     <OPTION>Foreign Review</option>
     <OPTION>Hollywood Review</option>
     </select>
   </b>
   <input name="Action" type="hidden" id="Action" value="1">
   <br>
   Enter the <b>MovieTitle</b><br>
   <input type="text" name="title" size="50">
   <br>
   Enter the <b>Main Language Spoken<br>
 </b>
   <input type="text" name="language" size="50">
   <br>
   Enter <b>The Year The Movie Was Released</b><br>
   <input type="text" name="yearz" size="50"><br>
   Enter the <b>Name Of The Star</b><br>
   <input type="text" name="star" size="50">
   <br>
   Enter the <b> Name Of The Director<br>
   </b>
   <input type="text" name="direct" size="50">
   <br>
   Enter the <b>Country</b><br>
   <input type="text" name="kuni" size="50">
 <br>
   Enter the <b>Category<br>
 <select size="1" name="category">
<OPTION>Action</option>
<OPTION>Comedy</option>
<OPTION>Drama</option>
<OPTION>Horror</option>
<OPTION>Martial Arts</option>
<OPTION>Porn</option>
<OPTION>Sci-Fi</option>
 </select></b><br>
   Enter the <b>Name Of The Reviewer</b><br>
   <input type="text" name="name" size="50">
   <br>
   Enter the <b>Review Summary<br>
 </b>
   <input type="text" name="summary" size="50">
   <br>
   Enter <b>The Review</b><br>
   <textarea rows="25" name="review" cols="100"></textarea>
   <br>
   <input type="submit" value="Submit" name="B1">
   <input type="reset" value="Reset" name="B2">
 </p>
</form>
<%
Dim DConn, rrs

action=Request.Form("Action")
If Action=1 Then

    area = replace(request.form("area"),"""","''")
   yearz = "# "&request.form("yearz")&" #"      
   title = replace(request.form("title"),"""","''")
    language = replace(request.form("language"),"""","''")
    star = replace(request.form("star"),"""","''")
    director = replace(request.form("director"),"""","''")
    kuni = replace(request.form("kuni"),"""","''")
    category = replace(request.form("category"),"""","''")
    name = replace(request.form("name"),"""","''")
    summary = replace(request.form("summary"),"""","''")
    review = replace(request.form("review"),"""","''")
   Set Conn = server.CreateObject("ADODB.Connection")
   Conn.Open "provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE='C:\Inetpub\wwwroot\Nattsumi\HK\movie\reviews.mdb'"
   SQL = "INSERT INTO PTBL_REVIEW (AREA, YEARZ, TITLE, LANGUAGE, STAR, DIRECTOR, KUNI, CATEGORY, NAME, SUMMARY, REVIEW) VALUES (""" & area & """, " & yearz & ",  """ & title & """, """ & language & """, """ & star & """, """ & director & """, """ & kuni & """, """ & category & """, """ & name & """, """ & review & """)"
   Set rrs = CConn.Execute(SQL)
   Set rrs = nothing
    End If
%>

I would appreciate any sorta help I could get
0
Comment
Question by:vcdmaker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
10 Comments
 
LVL 2

Expert Comment

by:AccessHelpNet
ID: 8098917
Set rrs = CConn.Execute(SQL)

should probably be :

Conn.Execute(SQL)

to match Conn variable defined here :

Set Conn = server.CreateObject("ADODB.Connection")

Conn.Open "provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE='C:\Inetpub\wwwroot\Nattsumi\HK\movie\reviews.mdb'"

You don't need to set the results of the SQL to a recordset since it is an INSERT statement.

best regards,

Dave Kawliche
http://AccessHelp.net
http://1ClickDB.com
0
 

Author Comment

by:vcdmaker
ID: 8099299
Thanks, I made the changes...Can't believed I missed that, there all the same now but I'm now getting the follow error

Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/hk/movie/add2.asp, line 81

<%@LANGUAGE="VBSCRIPT"%>
<form method="POST" action="add2.asp">
 <p>Enter the <b>AREA TO INPUT TO<br>
   <select size="1" name="area">
     <OPTION>Foreign Review</option>
     <OPTION>Hollywood Review</option>
     </select>
   </b>
   <input name="Action" type="hidden" id="Action" value="1">
   <br>
   Enter the <b>MovieTitle</b><br>
   <input type="text" name="title" size="50">
   <br>
   Enter the <b>Main Language Spoken<br>
 </b>
   <input type="text" name="language" size="50">
   <br>
   Enter <b>The Year The Movie Was Released</b><br>
   <input type="text" name="yearz" size="50"><br>
   Enter the <b>Name Of The Star</b><br>
   <input type="text" name="star" size="50">
   <br>
   Enter the <b> Name Of The Director<br>
   </b>
   <input type="text" name="direct" size="50">
   <br>
   Enter the <b>Country</b><br>
   <input type="text" name="kuni" size="50">
 <br>
   Enter the <b>Category<br>
 <select size="1" name="category">
<OPTION>Action</option>
<OPTION>Comedy</option>
<OPTION>Drama</option>
<OPTION>Horror</option>
<OPTION>Martial Arts</option>
<OPTION>Porn</option>
<OPTION>Sci-Fi</option>
 </select></b><br>
   Enter the <b>Name Of The Reviewer</b><br>
   <input type="text" name="name" size="50">
   <br>
   Enter the <b>Review Summary<br>
 </b>
   <input type="text" name="summary" size="50">
   <br>
   Enter <b>The Review</b><br>
   <textarea rows="25" name="review" cols="100"></textarea>
   <br>
   <input type="submit" value="Submit" name="B1">
   <input type="reset" value="Reset" name="B2">
 </p>
</form>
<%
Dim DConn, rrs

action=Request.Form("Action")
If Action=1 Then

    area = replace(request.form("area"),"""","''")
   yearz = "# "&request.form("yearz")&" #"      
   title = replace(request.form("title"),"""","''")
    language = replace(request.form("language"),"""","''")
    star = replace(request.form("star"),"""","''")
    director = replace(request.form("director"),"""","''")
    kuni = replace(request.form("kuni"),"""","''")
    category = replace(request.form("category"),"""","''")
    name = replace(request.form("name"),"""","''")
    summary = replace(request.form("summary"),"""","''")
    review = replace(request.form("review"),"""","''")
   
   Set DConn = server.CreateObject("ADODB.Connection")
   DConn.Open "provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE='C:\Inetpub\wwwroot\Nattsumi\HK\movie\reviews.mdb'"
   SQL = "INSERT INTO PTBL_REVIEW (AREA, YEARZ, TITLE, LANGUAGE, STAR, DIRECTOR, KUNI, CATEGORY, NAME, SUMMARY, REVIEW) VALUES (""" & area & """, " & yearz & ",  """ & title & """, """ & language & """, """ & star & """, """ & director & """, """ & kuni & """, """ & category & """, """ & name & """, """ & review & """)"
   Set rrs = DConn.Execute(SQL)
   Set rrs = nothing
    End If
%>

Above is the code as it sits now...Line 81 @ least where I am is: Set rrs = DConn.Execute(SQL)

Again, I would appreciate any help
0
 
LVL 2

Expert Comment

by:AccessHelpNet
ID: 8099389
To help debug the SQL do :

response.write SQL

before :

DConn.Execute(SQL)

and post the results for review.

2 things I notice right off is you are missing value for SUMMARY field and the field named NAME should probably be bracketed in the SQL as [NAME] to prevent possible problem with it being a reserved word.

best regards,

Dave Kawliche
http://AccessHelp.net
http://1ClickDB.com
0
Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

 

Author Comment

by:vcdmaker
ID: 8100019
put the response.write command. And not all of the fields were showing up. I fixed that so now the output looks likes:

INSERT INTO PTBL (AREA, YEARS, TITLE, LANGUAGE, STAR, DIRECTOR, KUNI, CATEGORY, REVIEWER, SUMMARIES, REVIEW) VALUES ("Foreign Review", "year", "title", "language", "star", "directory", "country", "Action", "reviewer", "summary", "review")

I'm still getting the
Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/hk/movie/add2.asp, line 82

error and it's still referring to
Set b = DConn.Execute(SQL)

HERE's the SQL code, I don't think you need the form stuff, it's still the same as above, only some of the names are changed:

<%
Dim DConn, b

action=Request.Form("Action")
If Action=1 Then

    area = replace(request.form("area"),"""","''")
    years = replace(request.form("years"),"""","''")
    title = replace(request.form("title"),"""","''")
    language = replace(request.form("language"),"""","''")
    star = replace(request.form("star"),"""","''")
    director = replace(request.form("director"),"""","''")
    kuni = replace(request.form("kuni"),"""","''")
    category = replace(request.form("category"),"""","''")
    reviewer = replace(request.form("reviewer"),"""","''")
    summaries = replace(request.form("summaries"),"""","''")
    review = replace(request.form("review"),"""","''")
     
   Set DConn = server.CreateObject("ADODB.Connection")
   DConn.Open "provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE='C:\Inetpub\wwwroot\Nattsumi\HK\movie\reviews.mdb'"
   SQL = "INSERT INTO PTBL (AREA, YEARS, TITLE, LANGUAGE, STAR, DIRECTOR, KUNI, CATEGORY, REVIEWER, SUMMARIES, REVIEW) VALUES (""" & area & """, """ & years & """,  """ & title & """, """ & language & """, """ & star & """, """ & director & """, """ & kuni & """, """ & category & """, """ & reviewer & """, """ & summaries & """, """ & review & """)"
   
   response.write SQL
   Set b = DConn.Execute(SQL)
   Set b = nothing
    End If
%>

0
 
LVL 2

Expert Comment

by:AccessHelpNet
ID: 8100618
LANGUAGE is a reserved word and needs to be bracketed as [LANGUAGE]

SQL = "INSERT INTO PTBL (AREA, YEARS, TITLE, [LANGUAGE], STAR, DIRECTOR, KUNI, CATEGORY, REVIEWER, SUMMARIES, REVIEW) VALUES (""" & area & """, """ & years & """,  """ & title & """, """ & language & """, """ & star & """, """ & director & """, """ & kuni & """, """ & category & """, """ & reviewer & """, """ & summaries & """, """ & review & """)"

best regards,

Dave Kawliche
http://AccessHelp.net
http://1ClickDB.com
0
 

Author Comment

by:vcdmaker
ID: 8108343
alright, well I just changed the language variable, it became just lang. That got rid of the Insert Into Error, but now I get

Microsoft JET Database Engine error '80040e14'

The INSERT INTO statement contains the following unknown field name: 'LANG'. Make sure you have typed the name correctly, and try the operation again.

/hk/movie/add.asp, line 83

I'm getting all the output though:
INSERT INTO PTBL (AREA, YEARS, TITLE, LANG, STAR, DIRECTOR, KUNI, CATEGORY, REVIEWER, SUMMARIES, REVIEW) VALUES ("Foreign Review", "year", "title", "language", "star", "director", "country", "Action", "reviewer", "summary", "review")

anyway, here's the latest code:
<%
Dim DConn, b

action=Request.Form("Action")
If Action=1 Then

    area = replace(request.form("area"),"""","''")
    years = replace(request.form("years"),"""","''")
    title = replace(request.form("title"),"""","''")
    lang = replace(request.form("lang"),"""","''")
    star = replace(request.form("star"),"""","''")
    director = replace(request.form("director"),"""","''")
    kuni = replace(request.form("kuni"),"""","''")
    category = replace(request.form("category"),"""","''")
    reviewer = replace(request.form("reviewer"),"""","''")
    summaries = replace(request.form("summaries"),"""","''")
    review = replace(request.form("review"),"""","''")
     
   Set DConn = server.CreateObject("ADODB.Connection")
   DConn.Open "provider=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE='C:\Inetpub\wwwroot\Nattsumi\HK\movie\reviews.mdb'"
   SQL = "INSERT INTO PTBL (AREA, YEARS, TITLE, LANG, STAR, DIRECTOR, KUNI, CATEGORY, REVIEWER, SUMMARIES, REVIEW) VALUES (""" & area & """, """ & years & """,  """ & title & """, """ & lang & """, """ & star & """, """ & director & """, """ & kuni & """, """ & category & """, """ & reviewer & """, """ & summaries & """, """ & review & """)"
   
   response.write SQL
   Set b = DConn.Execute(SQL)
   Set b = nothing
    End If
%>

Any help would be kewl. Thanks
0
 
LVL 2

Accepted Solution

by:
AccessHelpNet earned 200 total points
ID: 8111185
If you change the field name to LANG in the SQL you will also have to change it in the database table.

Otherwise you can just bracket the name in the SQL as [LANGUAGE] and leave the table alone (do not change the fieldname in the database to [LANGUAGE] or you will have other problems).

best regards,

Dave Kawliche
0
 

Author Comment

by:vcdmaker
ID: 8113189
I got to finally work!!! =).

Thanks for all the help

0
 
LVL 17

Expert Comment

by:walterecook
ID: 10337028
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: AccessHelpNet {http:#8111185}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

walterecook
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question