Results 1 to 2 of 2

Thread: An error occured while creating object WScript

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2004
    Posts
    100

    An error occured while creating object WScript

    Hi all.

    I am developing an ASP website and using MS Access as database.
    I keep getting this error:
    An error occured while creating object WScript
    when I click at hyperlink at my web menu. Not to only one hyperlink, but it happens to all the hyperlinks created at my website.

    Why this error occured? Hope, somebody can explain.

    Thanks in advance.

  2. #2
    PowerPoster
    Join Date
    May 2006
    Posts
    2,988

    Re: An error occured while creating object WScript

    Do you have an example of the code where this is happening?

    A basic example of creating the Database Object and Closing it would be like this .. where conn is the connection object ..

    so to open and run an SQL statement you would do like this

    VB Code:
    1. OpenDBConnection Server.Mappath("./MyFile.mdb"), conn
    2. Set rs = conn.Execute("SELECT * FROM myTable;")
    3. If Not rs.EOF then
    4.  ... do some code
    5. End If
    6. CloseDBConnection conn

    VB Code:
    1. '// OPEN DATABASE CONNECTION
    2. SUB OpenDBConnection(dbfile, conn)
    3.     set conn = server.createobject("ADODB.Connection")
    4.     conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & dbfile
    5. END SUB
    6.  
    7. '// CLOSE DATABASE CONNECTION
    8. SUB CloseDBConnection(conn)
    9.     conn.close
    10.     set conn=nothing
    11. END SUB
    Last edited by rory; May 17th, 2006 at 02:19 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
  •  



Click Here to Expand Forum to Full Width