No Database?

Discussion in 'AutoCAD' started by john m, Jul 6, 2004.

  1. john m

    john m Guest

    Hello,

    I have a few vba routines that are suddenly not working.

    One gives the error "No Database" and another says "Catastrophic
    Failure"

    I have recently been playing around with Dot Net and VB8 express.

    Any ideas what has caused this?

    thanks

    jm
     
    john m, Jul 6, 2004
    #1
  2. You've not given enough information to solicit a useful answer, John.

    You might consider posting the source for a routine which exhibits this
    problem along with a description of the circumstances sourrounding the
    failure.
     
    Frank Oquendo, Jul 6, 2004
    #2
  3. john m

    john m Guest

    Hello,

    ok well the one program is pretty simple it just inserts a block -see below
    the circumstances is that i open autocad 2004 and run this and it crashes
    "runtime error (some number)"
    "no database"
    i assume this refers to the ACAD database since i am not doing any thing
    extravagant

    the other program crashes when i am getting a selection set and stepping
    through it to get the attributes
    "catastophic failure"

    all these programs worked fine until i downloaded the dot net deal

    thanks for any assistance

    JM

    Option Explicit

    Private Sub cmdInsert_Click()
    Dim strBlockName As String

    If opt60 Then strBlockName = "vfd60hp"
    If opt150 Then strBlockName = "vfd150hp"
    If opt200 Then strBlockName = "vfd200hp"
    If opt475 Then strBlockName = "vfd475hp"
    Insert_A_Block (strBlockName)

    End Sub


    Private Sub opt208_Click()
    opt60.Caption = "30 HP"
    opt150.Caption = "60 HP"
    opt200.Caption = "100 HP"
    End Sub

    Private Sub opt460_Click()
    opt60.Caption = "60 HP"
    opt150.Caption = "150 HP"
    opt200.Caption = "200 HP"
    End Sub


    Public Sub Insert_A_Block(BName As String)
    Dim dblScale As Double
    Dim ismetric As Integer
    dblScale = 1
    BName = EquipmentDirectory & "VFD\" & BName
    With ThisDrawing
    .Layers.Add ("M-EQPT")
    .Layers("M-EQPT").color = acBlue
    .SetVariable "CLAYER", "M-EQPT"
    ismetric = .GetVariable("useri5")
    If ismetric = 1 Then dblScale = dblScale * 25.4

    .SendCommand ("-insert" & vbCr)
    .SendCommand (BName & vbCrLf & "Scale" & vbCr & Str(dblScale) &
    vbCr)
    End With
    Me.Hide
    End Sub
     
    john m, Jul 6, 2004
    #3
  4. john m

    Murph Guest

    Look up "ThisDrawing.ModelSpace.InsertBlock" instead of the "dreaded"
    Sendcommand. It will make your life a lot easier.

    Murph
     
    Murph, Jul 6, 2004
    #4
  5. john m

    john m Guest

    Thanx

    But this still doesn't explain why none of my vba routines work any more
    They still work fine on other peoples machines
    I feel it must have something to do with something i installed
    like the 2005 express beta vb8 deal

    it worked fine last week

    should i just re-install autocad?
    is there a patch to fix this problem?
    should i uninstall the Dot Net junk?

    has anyone else had all vba routines start suddenly crashing?

    JM
     
    john m, Jul 6, 2004
    #5
  6. john m

    Matt W Guest

    The information is sloooowly leaking out.
    Let me see if I've got this straight....
    You have 2004 *and* a 2005 beta installed on the same PC or did you install
    this Express 2005 beta on top of 2004??

    Speaking from experience, when I had 2004 and the Beta version of ABS 2005,
    some of my VBA apps wouldn't run.

    --
    Matt W

    The difference between genius and stupidity is that genius has its limits.
    | Thanx
    |
    | But this still doesn't explain why none of my vba routines work any more
    | They still work fine on other peoples machines
    | I feel it must have something to do with something i installed
    | like the 2005 express beta vb8 deal
    |
    | it worked fine last week
    |
    | should i just re-install autocad?
    | is there a patch to fix this problem?
    | should i uninstall the Dot Net junk?
    |
    | has anyone else had all vba routines start suddenly crashing?
    |
    | JM
    |
    | | > Look up "ThisDrawing.ModelSpace.InsertBlock" instead of the "dreaded"
    | > Sendcommand. It will make your life a lot easier.
    | >
    | > Murph
    | >
    | > | > > Hello,
    | > >
    | > > ok well the one program is pretty simple it just inserts a block -see
    | > below
    | > > the circumstances is that i open autocad 2004 and run this and it
    | crashes
    | > > "runtime error (some number)"
    | > > "no database"
    | > > i assume this refers to the ACAD database since i am not doing any
    thing
    | > > extravagant
    | > >
    | > > the other program crashes when i am getting a selection set and
    stepping
    | > > through it to get the attributes
    | > > "catastophic failure"
    | > >
    | > > all these programs worked fine until i downloaded the dot net deal
    | > >
    | > > thanks for any assistance
    | > >
    | > > JM
    | > >
    | > > Option Explicit
    | > >
    | > > Private Sub cmdInsert_Click()
    | > > Dim strBlockName As String
    | > >
    | > > If opt60 Then strBlockName = "vfd60hp"
    | > > If opt150 Then strBlockName = "vfd150hp"
    | > > If opt200 Then strBlockName = "vfd200hp"
    | > > If opt475 Then strBlockName = "vfd475hp"
    | > > Insert_A_Block (strBlockName)
    | > >
    | > > End Sub
    | > >
    | > >
    | > > Private Sub opt208_Click()
    | > > opt60.Caption = "30 HP"
    | > > opt150.Caption = "60 HP"
    | > > opt200.Caption = "100 HP"
    | > > End Sub
    | > >
    | > > Private Sub opt460_Click()
    | > > opt60.Caption = "60 HP"
    | > > opt150.Caption = "150 HP"
    | > > opt200.Caption = "200 HP"
    | > > End Sub
    | > >
    | > >
    | > > Public Sub Insert_A_Block(BName As String)
    | > > Dim dblScale As Double
    | > > Dim ismetric As Integer
    | > > dblScale = 1
    | > > BName = EquipmentDirectory & "VFD\" & BName
    | > > With ThisDrawing
    | > > .Layers.Add ("M-EQPT")
    | > > .Layers("M-EQPT").color = acBlue
    | > > .SetVariable "CLAYER", "M-EQPT"
    | > > ismetric = .GetVariable("useri5")
    | > > If ismetric = 1 Then dblScale = dblScale * 25.4
    | > >
    | > > .SendCommand ("-insert" & vbCr)
    | > > .SendCommand (BName & vbCrLf & "Scale" & vbCr & Str(dblScale)
    &
    | > > vbCr)
    | > > End With
    | > > Me.Hide
    | > > End Sub
    | > >
    | > > | > > > john m wrote:
    | > > >
    | > > > > Any ideas what has caused this?
    | > > >
    | > > > You've not given enough information to solicit a useful answer,
    John.
    | > > >
    | > > > You might consider posting the source for a routine which exhibits
    | this
    | > > > problem along with a description of the circumstances sourrounding
    the
    | > > > failure.
    | > > >
    | > > > --
    | > > > "It's beauty that captures your attention; personality which
    captures
    | > > > your heart."
    | > > >
    | > > >
    | > >
    | > >
    | >
    | >
    |
    |
     
    Matt W, Jul 6, 2004
    #6
  7. john m

    john m Guest

    Hello,

    No I was speaking of a different program
    the name of the program is Visual Basic Dot Net
    it is the beta version of Visual Basic 8
    It has nothing to do with autocad or autodesk
    However, when i installed it, all my VBA routines which have worked fine for
    months have ceased to function

    my operating system is called Windows 2000 "Professional"

    i just wanted more info on these error messages "Database not found"
    and "catastrophic failure"

    has anyone else gotten these errors?

    thanks
     
    john m, Jul 6, 2004
    #7
  8. john m

    Murph Guest

    John,
    I'm running that "express beta" from MS also on my home machince. If I get
    home at a decent hour tonight I'll check and see if it happens with my
    AutoCAD versions. I did notice it didn't want to play right with some other
    VB.Net apps I played with over the week-end. After all it is a *beta* from
    MS.

    Murph
     
    Murph, Jul 6, 2004
    #8
  9. john m

    john m Guest

    Thanks Murph I would appreciate that
    I think I'm goin nuts... not one of four different vba routines i have tried
    works now

    when they say "Catastrophic Failure" They aint kiddin

    jm
     
    john m, Jul 6, 2004
    #9
  10. I've only ever seen a "Catastrophic Failure" error message once before and in that case I thought the message was a bit melodramatic.
     
    Nathan Taylor, Jul 7, 2004
    #10
  11. john m

    James Murphy Guest

    John,
    I got the chance to try it and have no problems. OS XP home, AutoCAD Map 3D
    2005, also the Express beta and VS.net installed along with a few others.
    Sounds a little like the VS debugger is catching errors, look in your task
    manager and see if a debugger is running.

    Murph
     
    James Murphy, Jul 7, 2004
    #11
  12. john m

    john m Guest

    Thanks Murph

    Thanks for checking and thanks for the suggestion, it gives me some ideas to
    try..

    JM
     
    john m, Jul 7, 2004
    #12
  13. Hi John,
    This will cause an error if the layer "M-EQPT" already exists.

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au
     
    Laurie Comerford, Jul 7, 2004
    #13
  14. john m

    john m Guest

    Thanks to all who responded

    I finally fixed the problem by installing 2005

    something i needed to do anyway

    I know my code is not perfect

    but it seems to be working fine now

    no idea why

    JM
     
    john m, Jul 7, 2004
    #14
  15. Um... nope.

    Sub Test()
    Dim i As Integer
    For i = 0 To 5
    ThisDrawing.Layers.Add ("Test")
    Next i
    End Sub


    --
    R. Robert Bell


    Hi John,
    This will cause an error if the layer "M-EQPT" already exists.
     
    R. Robert Bell, Jul 8, 2004
    #15
  16. john m

    mctodd444 Guest

    I am having the same problem. My "old and faithful" VBA routines will not work since I installed ACAD 2005. I have Visual Studio.NET installed on this system.
     
    mctodd444, Feb 9, 2005
    #16
  17. john m

    mctodd444 Guest

    I am having the same problem. I have Visual Studio.NET installed on my system. Everything was fine until we upgraded to Acad 2005. Now my old "tried and true" VBA applications are giving me either "No database" or "catastrophic failure." We plan to deploy a new manufacturing system written in vb.NET in the near future so we have to find a remedy for this. Any information would be appreciated.
     
    mctodd444, Feb 9, 2005
    #17
  18. john m

    mctodd444 Guest

    I am having the same problem. I have Visual Studio.NET installed on my system. Everything was fine until we upgraded to Acad 2005. Now my old "tried and true" VBA applications are giving me either "No database" or "catastrophic failure." We plan to deploy a new manufacturing system written in vb.NET in the near future so we have to find a remedy for this. Any information would be appreciated. By the way, the three users without .NET on their computers are working fine. I think .NET is the issue.
     
    mctodd444, Feb 9, 2005
    #18
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.