LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import from Excel to an access database using Jet in vb.net

how u declare 'MyDatabase' is a proper way?
It will have the error if u just simply write 'MyDatabase' inside the code because it have not state the path of location of the database. can show me the full coding? thanks!

On Thursday, February 07, 2008 4:04 AM AndyH wrote:


I can import data from Excel to a non protected access database using the
code below.
How can I amend the code to import the data when 'myDatabase' is password
protected ?

Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
source=myExcelFile;Extended Properties='Excel 8.0;HDR=YES;'"
Comm.CommandType = CommandType.Text
Comm.CommandText = "SELECT * INTO tblNew IN 'myDatabase' FROM [Sheet1$]"
Comm.Connection = Conn
Conn.Open()
Comm.ExecuteNonQuery()
Conn.Close



Submitted via EggHeadCafe
Stock Quotes via jQuery-enabled WCF Service, JSON, and jQuery Templates
http://www.eggheadcafe.com/tutorials...templates.aspx

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database query to import from Access to Excel David T Excel Discussion (Misc queries) 0 August 31st 06 07:12 PM
How to import data from Access Database. vidi[_2_] Excel Programming 2 July 20th 06 07:29 PM
How to import multiple sheet of excel into Access database to a diffrent tables?? baka Excel Discussion (Misc queries) 0 July 6th 06 05:48 AM
Import to excel Access database directly to a variable (not using sheets) internacio Excel Programming 2 January 30th 06 02:03 PM
Excel error while trying to import data from an Access database - MSQRY32.exe has generated errors X_HOBBES Excel Discussion (Misc queries) 0 March 15th 05 06:46 PM


All times are GMT +1. The time now is 01:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"