Results 1 to 10 of 10

Error #13 during importing data. query error?? or wot?

Threaded View

sspandit Error #13 during importing... 02-02-2010, 02:06 AM
sspandit Re: Error #13 during... 02-02-2010, 02:39 AM
sspandit Re: Error #13 during... 02-02-2010, 04:51 AM
romperstomper Re: Error #13 during... 02-02-2010, 04:59 AM
sspandit Re: Error #13 during... 02-02-2010, 05:34 AM
romperstomper Re: Error #13 during... 02-02-2010, 05:38 AM
sspandit Re: Error #13 during... 02-02-2010, 05:45 AM
romperstomper Re: Error #13 during... 02-02-2010, 05:48 AM
sspandit Re: Error #13 during... 02-02-2010, 05:54 AM
romperstomper Re: Error #13 during... 02-02-2010, 06:02 AM
  1. #1
    Registered User
    Join Date
    11-23-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    18

    Arrow Error #13 during importing data. query error?? or wot?

    I imported some data from an MDB file while working at home.
    created a macro to that effect. and it works fine at my home PC.
    but when i try t execute this macro on another PC or work place, then it gives error #13. i dont understand why. something is wrong with the code. i think it is the "WITH" code for query tables connection giving error. can anyone debug this for me please. posting the whole code below.

    Sub data1()
    
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    Dim filename1 As Variant
    
    Sheets("DESIGNDATA").Select
    If Range("a1") <> "" Then
       Range("A1:D4000").Select
       Selection.ClearContents
       Selection.QueryTable.Delete
       Sheets("towers").Select
    End If
      
        
    filename1 = Application.GetOpenFilename( _
    filefilter:="MS Access Database, *.mdb", _
    Title:="Select Your MDB file")
    
    If filename1 = False Then
        MsgBox "You Have Cancelled"
    Application.ScreenUpdating = True
    Application.Calculation = xlCalculationAutomatic
    Exit Sub
    End If
    Sheets("towers").Select
    
     
        With Sheets("DESIGNDATA").QueryTables.Add(Connection:=Array(Array( _
            "ODBC;DSN=MS Access Database;DBQ=" & filename1 & ";DefaultDir=" & filename1 & ";DriverI" _
            ), Array("d=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;")), _
            Destination:=Sheets("DESIGNDATA").Range("A1"))
            .CommandText = Array( _
            "SELECT `Concrete Design 1 - Column Summary Data - Indian IS 456-2000`.Story, `Concrete Design 1 - Column Summary Data - Indian IS 456-2000`.ColLine, `Concrete Design 1 - Column Summary Data - Indian I" _
            , _
            "S 456-2000`.SecID, `Concrete Design 1 - Column Summary Da" _
            , _
            "ta - Indian IS 456-2000`.As" & Chr(13) & "" & Chr(10) & "FROM `" & filename1 & "`.`Concrete Design 1 - Column Summary Data - Indian IS 456-2000` `Concrete Design 1 - Column Summary Data - Indi" _
            , "an IS 456-2000`")
            .Name = "Query from MS Access Database"
            .FieldNames = True
            .RowNumbers = False
            .FillAdjacentFormulas = False
            .PreserveFormatting = True
            .RefreshOnFileOpen = False
            .BackgroundQuery = True
            .RefreshStyle = xlInsertDeleteCells
            .SavePassword = False
            .SaveData = True
            .AdjustColumnWidth = True
            .RefreshPeriod = 0
            .PreserveColumnInfo = True
            .Refresh BackgroundQuery:=False
        End With
          
    Application.CutCopyMode = False
    Application.ScreenUpdating = True
    Announcement = MsgBox("ETABS Data Imported Successfully", , "Data Transfer Successful")
    Application.Calculation = xlCalculationAutomatic
     End Sub

    THIS WORKS AT HOME. BUT NOT AT MY WORKPLACE IN OFFICE.

    MIGHT I ADD. I HAVE MS ACCESS INSTALLED AT HOME. WHILE NO MS ACCESS INSTALLED AT MY WORK PLACE.
    do help someeone.
    Last edited by sspandit; 02-02-2010 at 05:58 AM. Reason: code font

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1