SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Lookup Script

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Baltimore
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lookup Script

    I have created a form so that I can do a lookup on the id field.
    The information is being passed from /look.asp to check.asp (code listed below). I am getting the following error message on the check.asp page.

    ---Error---
    Error Type:
    Sun ONE ASP VBScript runtime (0x800A01A8)
    Object required: 'cn'
    /coa/check.asp, line 19


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    Page:
    POST 19 bytes to /coa/check.asp

    POST Data:
    id=01&Submit=Submit

    Time:
    Thursday, December 21, 2006, 10:01:33 AM
    ---End Error---


    --- CODE for /check.asp ---<%@ Language=VBScript %>
    <%
    id = Request.Form("id")
    connectionstring = "DRIVER={MySQL ODBC 3.51 Driver};Server=domain.com;Database=ic;uid=xxx;password=xxx;"
    Set cn = Server.CreateObject("ADODB.Connection")
    cn.Open connectionstring
    Set dataset = Server.CreateObject("ADODB.Recordset")
    dataset.ActiveConnection = cn
    sqltext = "select * from description where id = '" & id & "'"
    dataset.open sqltext


    if not dataset.EOF then
    url = "/coa/records.asp?id=" & id
    else
    url = "/coa/error.asp"
    end if
    dataset.Close
    cn.Close
    %>


    Any suggestions?

  2. #2
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is on line 19?
    what asp server are you using?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    Baltimore
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, here is line 19:

    19 cn.Close
    20 %>

    I'm using win 2003 server.

  4. #4
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jleggett View Post
    I have created a form so that I can do a lookup on the id field.
    The information is being passed from /look.asp to check.asp (code listed below). I am getting the following error message on the check.asp page.

    ---Error---
    Error Type:
    Sun ONE ASP VBScript runtime (0x800A01A8)
    Object required: 'cn'
    /coa/check.asp, line 19


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    Page:
    POST 19 bytes to /coa/check.asp

    POST Data:
    id=01&Submit=Submit

    Time:
    Thursday, December 21, 2006, 10:01:33 AM
    ---End Error---


    --- CODE for /check.asp ---<&#37;@ Language=VBScript %>
    <%
    id = Request.Form("id")
    connectionstring = "DRIVER={MySQL ODBC 3.51 Driver};Server=domain.com;Database=ic;uid=xxx;password=xxx;"
    Set cn = Server.CreateObject("ADODB.Connection")
    cn.Open connectionstring
    Set dataset = Server.CreateObject("ADODB.Recordset")
    dataset.ActiveConnection = cn
    sqltext = "select * from description where id = '" & id & "'"
    dataset.open sqltext


    if not dataset.EOF then
    url = "/coa/records.asp?id=" & id
    else
    url = "/coa/error.asp"
    end if
    dataset.Close
    cn.Close
    %>


    Any suggestions?
    You can always go the olf fashioned way and...

    Delete this line:
    Code:
    dataset.ActiveConnection = cn
    And change this line:
    Code:
    dataset.open sqltext
    To:
    Code:
    dataset.open sqltext, cn, 3, 3
    (or to whatever cursor/lock type you need.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •