ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Connection/Import Error msgs (https://www.excelbanter.com/excel-programming/356565-connection-import-error-msgs.html)

Trudye[_2_]

Connection/Import Error msgs
 

I am receiving 2 error msgs:
1. Data file 'X:\Pre-Sale Inspections\outgoing\AT_20060320_042005.XML
not found would like to connect to 'X:\Pre-Sal
Inspections\outgoing\AT_20060320_042005.XML' instead?

Weather I click yes/no a second msg appears. Dialog box 'Pls Enter M
JET OLE DB Initialization Information'

The msg is occruing on the last line of code (.Refresh). The msg jus
started appearing when I changed the file path

With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password=" """;Use
ID=Admin;Data Source=X:\Pre-Sale Inspections\outgoing\" & TodaysFile _
, _
";Mode=Share Deny Write;Extended Properties=""HDR=YES;"";Je
OLEDB:System database="""";Jet OLEDB:Registry Path="""";Je
OLEDB:Database" _
, _
" Password="""";Jet OLEDB:Engine Type=35;Jet OLEDB:Databas
Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Globa
Bul" _
, _
"k Transactions=1;Jet OLEDB:New Database Password="""";Je
OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Je
" _
, _
"OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compac
Without Replica Repair=False;Jet OLEDB:SFP=False" _
), Destination:=Range("A1"))
.CommandType = xlCmdTable
.CommandText = Array("Sheet1$")
.Name = TodaysFile
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.SourceDataFile = _
"X:\Pre-Sale Inspections\outgoing\" & TodaysFile
.Refresh BackgroundQuery:=False
End Wit

--
Trudy
-----------------------------------------------------------------------
Trudye's Profile: http://www.excelforum.com/member.php...fo&userid=3249
View this thread: http://www.excelforum.com/showthread.php?threadid=52453



All times are GMT +1. The time now is 03:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com