Get a Microsoft VBScript runtime error '800a01c2' error, please help


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Get a Microsoft VBScript runtime error '800a01c2' error, please help

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Posts
    13

    Get a Microsoft VBScript runtime error '800a01c2' error, please help

    Hi,

    Get a Microsoft VBScript runtime error '800a01c2' error when i run this asp/vbscript code and i just cant figure out why. Please Help

    Code:
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <%
    Dim vhistory, conn, cst, strSQL
    vhistory = Request.QueryString
    
    cst = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
    "Data Source=" & Server.MapPath("ozone.mdb")
    
    set conn = CreateObject("ADODB.Connection")
    
    conn.open(cst)
    
    strSQL="SELECT application FROM patient WHERE ID = " & vhistory
    
    conn.execute(strSQL)
    
    Response.Write conn("application")
    %>
    </body>
    </html>

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    If you want to return a value from a query, you cannot simply use conn.Execute; you must use a Recordset. Try this:
    Code:
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Open cst
    set rs = Server.CreateObject("ADODB.recordset")
    rs.Open "SELECT application FROM patient WHERE ID = " & vhistory
    , conn
    Response.Write rs("application")
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Dec 2008
    Posts
    13
    that did the trick - thanks a lot phil

Similar Threads

  1. Microsoft VBScript runtime error '800a0009'
    By jgisler596 in forum VB Classic
    Replies: 5
    Last Post: 12-27-2006, 08:17 PM
  2. ANN: Release of DeKlarit 2.0 for Microsoft Visual Studio .NET
    By Maria Jose Serres in forum dotnet.announcements
    Replies: 0
    Last Post: 02-19-2003, 03:54 PM
  3. Replies: 0
    Last Post: 01-19-2002, 08:28 AM
  4. Microsoft Opportunity in DC
    By Tom Jarosz in forum Mobile
    Replies: 0
    Last Post: 03-14-2001, 11:35 AM
  5. Replies: 1
    Last Post: 11-30-2000, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center