Hi, I have a project that was roking just perfect, it has this code for passing data from an Excel file to SQL 2000. I recently changed my computer and I got XP (I developed this with win2k) I had to install everything from scratch, SQL, IIS, .NET, etc. now
I'm getting this error when trying to use it: The Microsoft Jet database engine could not find the object 'Sheet1'. Make sure the object exists and that you spell its name and the path name correctly. Any ideas? Should I install some SP or something like that???
Thanks, Marcela //**************************************** 'Create variables that are used in code sample. Dim i, j As Integer Dim sConnectionStr As String Dim oCmdSelect As New OleDbCommand() Dim oConnection As New OleDbConnection() Dim oDataReader As OleDb.OleDbDataReader
'Modify the "Data Source" parameter as appropriate for your environment. sConnectionStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & path & ";" & "Extended Properties=Excel 8.0;" 'Create the connection object by using the preceding connection string.
oConnection.ConnectionString = sConnectionStr Try 'Open connection with the database. oConnection.Open() Catch e As Exception Throw e End Try 'Create new OleDbCommand to return data from worksheet. oCmdSelect.CommandText = Select [Factory Product], Operation,
Resource, [Model Product] FROM [Sheet1$]" oCmdSelect.Connection = oConnection 'Pass the Select command to the reader oDataReader = oCmdSelect.ExecuteReader(CommandBehavior.CloseConnection) Return oDataReader
mvillal
Member
45 Points
9 Posts
Problems with Jet Database engine after changing computer
Oct 21, 2003 03:56 AM|LINK
douglas.reil...
All-Star
23315 Points
4647 Posts
Re: Problems with Jet Database engine after changing computer
Oct 21, 2003 09:07 AM|LINK
Programming Microsoft Web Forms
My Blog
mvillal
Member
45 Points
9 Posts
Re: Problems with Jet Database engine after changing computer
Oct 21, 2003 02:03 PM|LINK