Results 1 to 2 of 2

Thread: object required error

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    30

    object required error

    hello all, I have this basic vb code

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3. Dim constr As String
    4.  
    5. constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\spec.mdb"
    6. fImpconn.Open constr
    7.  
    8.  
    9. 'Add a new column for the changed data type
    10.  
    11. fImpconn.Execute "ALTER TABLE temp ADD COLUMN primspec text(255)"
    12.  
    13. fImpconn.Close
    14.  
    15.  
    16. Set fImpconn = Nothing
    17. MsgBox ("Processing is complete")
    18.  
    19.  
    20. End Sub

    During the execution I get a runtime error 424 - object not found on this line

    fImpconn.Open constr

    but I do have a spec.mdb in the same folder as the program. Not sure what I am doing wrong.

    I also added Microsoft Active X data objects 2.7 as a reference.

    Any ideas.

  2. #2

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