"Server" was not handled 
Author Message
 "Server" was not handled

Please help!
I'm trying to connect to my first database using VBScript and MS
Access, but I keep getting this error message:
"Object Required: 'server" was not handled"
Can anyone tell me what I'm doing wrong?

thanks

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Wed, 19 Feb 2003 01:33:40 GMT  
 "Server" was not handled

Sounds like a syntactical error.

Can you post the offending snippit of code
so we can see how you're trying to access the
database.

Are you using DAO? ADODB?

-Chad


Quote:
> Please help!
> I'm trying to connect to my first database using VBScript and MS
> Access, but I keep getting this error message:
> "Object Required: 'server" was not handled"
> Can anyone tell me what I'm doing wrong?

> thanks

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Wed, 19 Feb 2003 02:05:02 GMT  
 "Server" was not handled

You're probably trying to use the intrinsic ASP Server object in a non-ASP environment, like client
side HTML or a standalone WSH-hosted script...

--
Michael Harris
Microsoft.MVP.Scripting
--

Quote:

> Please help!
> I'm trying to connect to my first database using VBScript and MS
> Access, but I keep getting this error message:
> "Object Required: 'server" was not handled"
> Can anyone tell me what I'm doing wrong?

> thanks

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Wed, 19 Feb 2003 02:12:28 GMT  
 "Server" was not handled
Thanks for your help. I just got rid of the 'server' part, and that
seemed to work. Quickly, what I'm doing is: a user inputs a code and I
then look up the code in the Access Database and supply the user with
the code description. Seems to work fine when I open the page in
Frontpage, but when I open the page directly from IE, I get an error.
Do I need to "turn on" ASP anywhere? How do I do that? I'm running the
website from a NT server, with an Access 2k database.

The code is as follows, and I get the error message at line: ****

<!--#include virtual="/PROGRAM FILES/COMMON
FILES/SYSTEM/ADO/ADOVBS.INC"--&gt;
dbname="gatemed"
  'Establish a connection with data source.
  ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;data source="
  ConnStr =ConnStr & "c:\InetPub\" & dbname & ".mdb"
  mycode= txtCode.value
  sqlSelect ="SELECT * FROM tbl_ICD9 WHERE fld_code = '" & mycode & "'"

****  set adoxConn = createobject("adox.catalog")
  Set adodbConn = CreateObject("ADODB.Connection")
  adodbConn.open ConnStr
  adoxConn.activeConnection = adodbConn
  Set rs = CreateObject("ADODB.Recordset")
rs.Open sqlSelect, ConnStr

If rs.EOF Then
    txtDescription.value = "(Unknown Code)"
Else
    txtDescription.value = rs("fld_desc")
End If

rs.Close
Set rs = Nothing

thanks for your help!!

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 19 Feb 2003 02:53:24 GMT  
 "Server" was not handled
I think you're getting "server-side" and "client-side"
scripting mixed up.

First off, you have to put server-side VBScript in <% %>
tags. It doesn't appear you're doing this, which would
cause all sorts of problems.

Secondly, why are you using adox.catalog? Just out of curiosity.
I don't think I've ever used it, perhaps you know something
I don't?

Thirdly, you're using the "txtCode.value" on the server-side
which is a client-side control and isn't available to the server.

You'll have to have them fill out some info and post it to a
server ASP file and have the ASP file handle the form input.
You can access form input in ASP pages by using the
Request.Form object.

When I connect to an access db, I usually use a DSN, it
makes things easier.

Go to Data Sources in Control Panel (aka 32-bit Data Sources or
Data Sources (ODBC))

Create a new System DSN that points to your Access db. We'll
call it AxsDSN just for simplicity's sake.

Instead of using txtCode.Value, we're going to use the value that
was posted from the previous page. For more information on creating
HTML forms, please look up some documentation (www.webmonkey.com is
a good place to start). Set the FORM to POST to an ASP page.

Pretend in the previous form you had a <INPUT> tag like this:
<INPUT type="text" name="sCode">

That ASP page would look something like this:
-------------------------------------------

<!--#include virtual="/PROGRAM FILES/COMMON FILES/SYSTEM/ADO/ADVBS.INC">
<HTML><HEAD></HEAD>
<BODY>
<%
Dim cn, rs
Dim sSQL

Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

cn.Open "DSN=AxsDSN;"

sSQL = "SELECT * FROM tbl_ICD9 WHERE fld_code = '" & Request.Form("sCode") & "'"

rs.Open sSql, cn, adOpenDynamic, adLockOptimistic

If Not rs.EOF and Not rs.BOF Then
    Response.Write rs("fld_desc")
Else
    Response.Write "(Unknown Code)"
End If

rs.Close
cn.Close

Set rs = Nothing
Set cn = Nothing
%>
</BODY>
</HTML>
--------------------------------------------

-Chad


Quote:
> Thanks for your help. I just got rid of the 'server' part, and that
> seemed to work. Quickly, what I'm doing is: a user inputs a code and I
> then look up the code in the Access Database and supply the user with
> the code description. Seems to work fine when I open the page in
> Frontpage, but when I open the page directly from IE, I get an error.
> Do I need to "turn on" ASP anywhere? How do I do that? I'm running the
> website from a NT server, with an Access 2k database.

> The code is as follows, and I get the error message at line: ****

> <!--#include virtual="/PROGRAM FILES/COMMON
> FILES/SYSTEM/ADO/ADOVBS.INC"--&gt;
> dbname="gatemed"
>   'Establish a connection with data source.
>   ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;data source="
>   ConnStr =ConnStr & "c:\InetPub\" & dbname & ".mdb"
>   mycode= txtCode.value
>   sqlSelect ="SELECT * FROM tbl_ICD9 WHERE fld_code = '" & mycode & "'"

> ****  set adoxConn = createobject("adox.catalog")
>   Set adodbConn = CreateObject("ADODB.Connection")
>   adodbConn.open ConnStr
>   adoxConn.activeConnection = adodbConn
>   Set rs = CreateObject("ADODB.Recordset")
> rs.Open sqlSelect, ConnStr

> If rs.EOF Then
>     txtDescription.value = "(Unknown Code)"
> Else
>     txtDescription.value = rs("fld_desc")
> End If

> rs.Close
> Set rs = Nothing

> thanks for your help!!

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Wed, 19 Feb 2003 03:24:35 GMT  
 "Server" was not handled
Chad,
Thanks for all your input. I'm going to work through it this weekend.
The problem appears to be that I don't have the basic skills for what
I'm trying to do. I'm migrating from being an Access/VB developer to a
web developer. Not as easy as I would have hoped, but through necessity
I have to learn this stuff ASAP. Any suggestions on a good book?

btw, I just copied/pasted my code from a website I found. So, I don't
even know what the line: adox.catalog is all about.

I thought I was close because I can get the form to work when I open it
up from FrontPage, but not from IE directly. It must be the client side
vs. server side element you mentioned.

Thanks for your help!
Paul

Sent via Deja.com http://www.deja.com/
Before you buy.



Wed, 19 Feb 2003 04:17:17 GMT  
 "Server" was not handled

Wrox Press - Programmer to Programmer (TM)
http://www.wrox.com/Consumer/Store/ListTitles.asp?By=101

ASP 3.0 Programmer's Reference
http://www.wrox.com/Consumer/Store/Details.asp?ISBN=1861003234

ADO 2.6 Programmer's Reference
http://www.wrox.com/Consumer/Store/Details.asp?ISBN=186100463X

--
Michael Harris
Microsoft.MVP.Scripting
--



Wed, 19 Feb 2003 05:17:38 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Server.CreateObject() causing "object required: "Server" was not handled".

2. Handling Err68 "Device Not Available"

3. CreateObject("Excel","//server"), MsgBox output

4. CreateObject("Excel","//server"), MsgBox output

5. "Server not available"

6. "Object server not correctly registered" error

7. OLE - "Server not responding"

8. VB4 "Object Server Not Correctly Registered"

9. "Object Server Not Correctly Registered"

10. Error "Object Server not correctly registered"?

11. "Object Server Not Correctly Registered" - Solution

12. "Object server not correctly registered"

 

 
Powered by phpBB® Forum Software