Results 1 to 4 of 4

Thread: PLEASE HELP ON MY VB and VB SCRIPT

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    121

    PLEASE HELP ON MY VB and VB SCRIPT

    This is my code, it alway replied a error message, i cut the pix of error message, please help me.

    I will use this to run and correct the MDB database on error on "AO is not index", this error occur when i done compacting MDB database.

    Below is my script, i attached the picture message please help.

    <SCRIPT LANGUAGE="VBScript">
    <!--
    Option Explicit

    Const strDB = "C:\MYDATABASE.MDB"
    const vpassadmin = "cristine"



    Dim dbConnection

    Set dbConnection = CreateObject("ADODB.Connection")

    dbConnection.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=" &
    strDB & ";Uid=Admin;Pwd=" & cristine & ";"

    dbConnection.Execute "Drop Table MSysAccessObjects"

    dbConnection.Close

    Set dbConnection = nothing

    MsgBox "You should now be able to open the database!"

    -->
    </SCRIPT>

    <HTML>
    <HEAD>
    <TITLE> Database Correcting Error </TITLE>
    </HEAD>


    <BODY>
    Click the button plz...
    <HR>

    <FORM>
    <INPUT NAME = "process"
    TYPE = "BUTTON"
    VALUE = "Click here">
    </FORM>
    <HR>
    </BODY>
    </HTML>
    Attached Images Attached Images  

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: PLEASE HELP ON MY VB and VB SCRIPT

    Thread moved to ASP/VB Script forum

    First off, I suspect that the problem is caused by "Option Explicit", which is probably not supported by VB Script (as that is a compile-time option, and VB Script is interpreted instead of compiled).

    Next up, why are you trying to delete a system table from a database? If it works (hopefully it wont), that will probably cause severe problems.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2006
    Posts
    121

    Re: PLEASE HELP ON MY VB and VB SCRIPT

    actually i am not deleting database.... my MDB data file had error, "AO not in index"... i just saw that program on website... and they advised that i should make a script like that.. so that i can copy my database to another database so i can access it... if you knew already same problem with me.. can you assist me on my error...

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: PLEASE HELP ON MY VB and VB SCRIPT

    Deleting a system table is a very bad idea, as the system tables contain the information needed to make the database work (such as what tables are in the database, and which field is in each, etc etc). Deleting any of them will almost certainly make the problem much worse.

    If you really know what you are doing, modifying the data may work - but if you don't know enough (or you make any mistakes), the problem will again be likely to become worse.


    The route I would recommend is to perform a Compact and Repair on the database from within Access, as that should automatically correct the system tables (assuming that there hasn't been too much damage already).

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