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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to import Excel Spread sheet, but not geeting all the records 3

Status
Not open for further replies.

itmasterw

Programmer
Apr 13, 2003
147
US
Hi, I have an Excel file that I am trying ot import into an Access Table. I have been using a DoCmd.TransferSpreadsheet function to bring in the data, and it has worked up untill now. This one sheet it goes to about record 10001 and stops. does not give an error just stops bringing in anymore records. The data looks the same as the previous records. So I figured I would try a different approch, so I am trying to use the following to bring an Excel sheet:

Dim cn As New ADODB.Connection
Dim StrSQL As String
StrSQL = ""

cn.Open "Provider =Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = J:\APPSUPT\ServRelease\P10N Access Database\P10_To_Schedual.mdb;" & _
"JET OLEDB:Engine Type=4"

StrSQL = "SELECT * INTO [Funding_Temp] FROM [Excel 8.0;DATABASE = H:\E55\Desktop\MasterFunds2.xls;HDR=NO;IMEX=1].[Summary];"
cn.Execute StrSQL

However I am keep geting this reeor Coud not find file'H:\E55\Desktop\Excel 8.0'.

I am not sure qhy it is conncatinating it like that, and what I can do about it. If anyone has any ideas of what I can do about this, or why my original DoCmd.TransferSpreadsheet function is not working, please let me know.
Thank you
 
I can import from excel using this format:
Code:
INSERT INTO tblImportedCustomers ( CustomerID, Age, FirstName )
SELECT [Sheet1$].CustomerID, [Sheet1$].Age, [Sheet1$].FirstName
FROM [Sheet1$] IN 'C:\ImportCustomers.xls'[Excel 8.0;HDR=YES;]
and a make-table like this:
Code:
SELECT [Sheet1$].CustomerID, [Sheet1$].Age, [Sheet1$].FirstName INTO tblImportedCustomers
FROM [Sheet1$] IN 'C:\ImportCustomers.xls'[Excel 8.0;HDR=YES;];

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top