Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import error Msg

Status
Not open for further replies.

Trudye

Programmer
Sep 4, 2001
932
US
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-Sale Inspections\outgoing\AT_20060320_042005.XML' instead?

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

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

Here is the code:
With ActiveSheet.QueryTables.Add(Connection:=Array( _
"OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=X:\Pre-Sale Inspections\outgoing\" & TodaysFile _
, _
";Mode=Share Deny Write;Extended Properties=""HDR=YES;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database" _
, _
" Password="""";Jet OLEDB:Engine Type=35;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bul" _
, _
"k Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet " _
, _
"OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact 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 With
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top