I was wondering if there was a way to copy data from an excel spreadsheet into a Access Database from a VB Application. This is what I have so far...I keep getting an error saying the database engine cannot find sheet1 (of the Excel workbook). Any responses would be greatly appreciated.
Code:
Private Sub ConvertButton_Click()
' Variables
Dim strquery As String
' Connection Properties
Dim AccessCn As New ADODB.Connection
AccessCn.Provider = "Microsoft.Jet.OLEDB.4.0;"
AccessCn.Open AccessText.Text, LoginForm.UsernameText.Text, LoginForm.PasswordText.Text
strquery = "SELECT * INTO [CONVERSIONS] IN '" & AccessText.Text & "' FROM [Sheet1$]"
AccessCn.Execute strquery
[\code]
AccessText and ExcelText are text boxes which contain the paths for the Database and spreadsheet, respectively. There also exists a Login Form in which the user specifies a username and password for logging onto Access DB.
Thanks
-vza