473,573 Members | 2,958 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Microsoft VBScript runtime (0x800A01A8)

The ASP page has a combo box with id list, and when user click the
particular id, it will show the name in the text box. My attempt was when
the user have event on combo box, it will call JavaScript showempname(), and
it will then look up the name by executing SQL statement.

However, the following code has the following error:

Microsoft VBScript runtime (0x800A01A8)
Object required on line " sqlStmt = "select * from employee where EmployeeID
= "
<script language="JavaS cript">
function showempname()
{
if (document.event form.id.length > 1)
{
<%
Dim objRS
set objRS = Server.CreateOb ject("ADODB.Rec ordset")
sqlStmt = "select * from employee where EmployeeID = " _
& "'" & document.eventf orm.id.value & "'" & ";"
objRS.Open sqlStmt, strConnect
document.eventf orm.empname.val ue = objRS("FirstNam e")
Set objRS = Nothing
%>
}
}
</script>
</head>

<body>
<form name="eventform " action method="post">
<select name="id" onchange="showe mpname()">
<option value="1001">10 01</option>
<option value="1002">10 02</option>
<option value="1003">10 03</option>
</select>

<P>Name: <input type="text" name="empname">
Any ideas?? thanks!!
Jul 19 '05 #1
3 7285

"Matt" <ma*******@hotm ail.com> wrote in message
news:eF******** ******@TK2MSFTN GP11.phx.gbl...
<%
Dim objRS
set objRS = Server.CreateOb ject("ADODB.Rec ordset")
sqlStmt = "select * from employee where EmployeeID = " _
& "'" & document.eventf orm.id.value & "'" & ";"
Any ideas?? thanks!!


You're mixing client side code with server side code.

You need to use REquest.Form("I D") to read the form value when the page is
posted back to the server.

Also, I would say using the name 'ID' for your <select> is just asking for
trouble - rename it something unique that isn't a common key word.

eg 'EmpID'

Jul 19 '05 #2
Matt,
you are trying to do something really odd
You cannot mix clientside javascript and server side
code.
--
Roji. P. Thomas

--------------------------------------
"Matt" <ma*******@hotm ail.com> wrote in message
news:eF******** ******@TK2MSFTN GP11.phx.gbl...
The ASP page has a combo box with id list, and when user click the
particular id, it will show the name in the text box. My attempt was when
the user have event on combo box, it will call JavaScript showempname(), and it will then look up the name by executing SQL statement.

However, the following code has the following error:

Microsoft VBScript runtime (0x800A01A8)
Object required on line " sqlStmt = "select * from employee where EmployeeID = "
<script language="JavaS cript">
function showempname()
{
if (document.event form.id.length > 1)
{
<%
Dim objRS
set objRS = Server.CreateOb ject("ADODB.Rec ordset")
sqlStmt = "select * from employee where EmployeeID = " _
& "'" & document.eventf orm.id.value & "'" & ";"
objRS.Open sqlStmt, strConnect
document.eventf orm.empname.val ue = objRS("FirstNam e")
Set objRS = Nothing
%>
}
}
</script>
</head>

<body>
<form name="eventform " action method="post">
<select name="id" onchange="showe mpname()">
<option value="1001">10 01</option>
<option value="1002">10 02</option>
<option value="1003">10 03</option>
</select>

<P>Name: <input type="text" name="empname">
Any ideas?? thanks!!

Jul 19 '05 #3
so how can i handle this in my case?

well, if the user select the EmployeeID in combo box, and then click the
submit button, and it will look up database and show the Employee Name in
the text box, this is easy.

But my case is: when the user select the employeeid in combo box, it will
fire the onchange event, and then look up database and show the employee
name in the text box. There is no submit button.

I really have no idea how to do that.
"Roji. P. Thomas" <la********@som ewhere.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
Matt,
you are trying to do something really odd
You cannot mix clientside javascript and server side
code.
--
Roji. P. Thomas

--------------------------------------
"Matt" <ma*******@hotm ail.com> wrote in message
news:eF******** ******@TK2MSFTN GP11.phx.gbl...
The ASP page has a combo box with id list, and when user click the
particular id, it will show the name in the text box. My attempt was when the user have event on combo box, it will call JavaScript showempname(),

and
it will then look up the name by executing SQL statement.

However, the following code has the following error:

Microsoft VBScript runtime (0x800A01A8)
Object required on line " sqlStmt = "select * from employee where

EmployeeID
= "
<script language="JavaS cript">
function showempname()
{
if (document.event form.id.length > 1)
{
<%
Dim objRS
set objRS = Server.CreateOb ject("ADODB.Rec ordset")
sqlStmt = "select * from employee where EmployeeID = " _
& "'" & document.eventf orm.id.value & "'" & ";"
objRS.Open sqlStmt, strConnect
document.eventf orm.empname.val ue = objRS("FirstNam e")
Set objRS = Nothing
%>
}
}
</script>
</head>

<body>
<form name="eventform " action method="post">
<select name="id" onchange="showe mpname()">
<option value="1001">10 01</option>
<option value="1002">10 02</option>
<option value="1003">10 03</option>
</select>

<P>Name: <input type="text" name="empname">
Any ideas?? thanks!!


Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
15166
by: Matt | last post by:
<% hour = Request("controlname") %> will yield the following error: Microsoft VBScript runtime (0x800A01F5) Illegal assignment: 'hour' However, if I declare hour, then it is fine. <% Dim hour hour = Request("controlname") %>
1
8951
by: Carolyn Speakman | last post by:
Hi, I'm trying to amend an intranet .asp page but keep getting this error. The error only occurs when I pull the WHOLE intranet off the server and try to run it locally. The error isn't there when the page is run off the intranet server. I'm using IIS 5, I.E. 6 and WinXP Pro. Here's the code it doesn't like:
1
2744
by: PaulieS | last post by:
Hi all. Am migrating a customer from IIS5 on W2K server to IIS6 on W2K3. Zipped all the websites and unzipped them to the identical locations on new server. Used IISMT to migrate metabase. Got this error when I tried to run a very basic page... code:
2
15785
by: anidmarty | last post by:
Hey I'm a Sysadmin and my users are getting this error on my production box. It works fine on the dev box. There is a script that is run that generates this error. Production is clustered environment using Microsoft Application Center. This was working before and starting throwing this error about 15 days ago. any help would be much...
0
2059
by: =?Utf-8?B?TWF0dCBDYWxob29u?= | last post by:
HI there, I am getting an error on my page which calls up a web service. Microsoft VBScript runtime error '800a13ba' Unknown runtime error: 'SearchQueryXML' /SearchResults.asp, line 142
4
8831
by: Genken | last post by:
Hi can anybody help me i get this error when running this code. Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '' And then a line number indicating where the error is, i cant see any errors with this code please assist. Thanks in advance. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
1
3876
by: mudasserrafiq | last post by:
I am using following asp file default.asp <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <META http-equiv=Content-Type content="text/html; charset=windows-1252"> <META content="0 Days" name=revisit-after> <META content=info@siderinternational.com name=email> <META content="Omer Safdar" name=author> <META...
10
8013
by: jasone | last post by:
hi everyone! any advice given will be MUCH appreciated, i have spent about 10 hours on this bit of script... a rating system. I am having realt trouble overcoming this problem at runtime Microsoft VBScript runtime (0x800A01A8) Object required: '' /ddwassignment2/full_catalogue2.asp, line 180 please find the complete code listing...
1
2186
by: deepakalra | last post by:
hi, my project is about displaying map(and its info) based on query fired..the result of the query should be displayed in the form of report(collecting data from database)...the problem is when i uploaded the page,the error shown was:- The page cannot be displayed There is a problem with the page you are trying to reach and it cannot be...
0
7741
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7977
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8165
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5252
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3692
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
984
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.