OleDBDataAdapter and Excel file

  • Thread starter Thread starter Oriane
  • Start date Start date
O

Oriane

Hi,

I just want to configure a dataAdapter of an Excel file with Jet 4.0.
The problem is that, when I use the wizard I realize that I can connect to my file with the account "Admin" and an empty password. The connection test succeeds.

But when I'm finished with the wizard (clicking on the END button) a pop up window from the Server Explorer tells me to check my username and password and to try again.

I don't know where the "admin" account comes from. I tried with my username/password on my domain but the connection test fails.

Oriane
 
¤ Hi,
¤
¤ I just want to configure a dataAdapter of an Excel file with Jet 4.0.
¤ The problem is that, when I use the wizard I realize that I can connect to my file with the account "Admin" and an empty password. The connection test succeeds.
¤
¤ But when I'm finished with the wizard (clicking on the END button) a pop up window from the Server Explorer tells me to check my username and password and to try again.
¤
¤ I don't know where the "admin" account comes from. I tried with my username/password on my domain but the connection test fails.
¤
¤ Oriane

You are referring to the database password which isn't needed for an Excel file. Blank out these
fields.

The other option is not to use the Data Connection wizard or manually change the ConnectionProperty
for the resulting OleDbConnection.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
I mean that I don't have no more the pop up windows but I find myself with the first screen (step) of the wizard, and so it's imposible to fininsh the creation of the data adapter.

"Oriane" <[email protected]> a écrit dans le message de %[email protected]...
Hi Paul

It seems tha blanking out these fields does not solve the problem...

Thank you..
 
¤ I mean that I don't have no more the pop up windows but I find myself with the first screen (step) of the wizard, and so it's imposible to fininsh the creation of the data adapter.
¤

There seems to be a quirk in the wizard that causes this to happen. If you try it a second time
(without closing the Data Link Properties dialog) it should create a new Data Connection.

1) Select Microsoft Jet 4.0 OLEDB Provider
2) Select Excel File and blank out User Name
3) Set Extended Properties on All tab to Excel 8.0
4) Click OK

Repeat above four steps and Data Connection will be added.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hi Paul,

Paul Clement said:
There seems to be a quirk in the wizard that causes this to happen. I confirm !
If you try it a second time
(without closing the Data Link Properties dialog) it should create a new Data Connection.

1) Select Microsoft Jet 4.0 OLEDB Provider
2) Select Excel File and blank out User Name
3) Set Extended Properties on All tab to Excel 8.0
4) Click OK

Repeat above four steps and Data Connection will be added.
No because I've got a new "Nullreference" exception . I give up...

Thanks anyway.
 
¤ Hi Paul,
¤
¤ "Paul Clement" <[email protected]> a écrit dans le message de news: (e-mail address removed)...
¤ > There seems to be a quirk in the wizard that causes this to happen.
¤ I confirm !
¤ > If you try it a second time
¤ > (without closing the Data Link Properties dialog) it should create a new Data Connection.
¤ >
¤ > 1) Select Microsoft Jet 4.0 OLEDB Provider
¤ > 2) Select Excel File and blank out User Name
¤ > 3) Set Extended Properties on All tab to Excel 8.0
¤ > 4) Click OK
¤ >
¤ > Repeat above four steps and Data Connection will be added.
¤ No because I've got a new "Nullreference" exception . I give up...
¤
¤ Thanks anyway.

As I mentioned you're probably better off creating the data connection using code:

Dim ConnectionString As String

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;" & _
"Extended Properties=""Excel 8.0;HDR=No;IMEX=1"""

Dim ExcelConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
ExcelConnection.Open()


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Paul Clement said:
As I mentioned you're probably better off creating the data connection using code:

Dim ConnectionString As String

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\Book20.xls;" & _
"Extended Properties=""Excel 8.0;HDR=No;IMEX=1"""

Dim ExcelConnection As New System.Data.OleDb.OleDbConnection(ConnectionString)
ExcelConnection.Open()


Paul
~~~~
Microsoft MVP (Visual Basic)
Yes of course, and this is what I do. But I would have liked to benefit from the "cool stuff" of VS 2003 ;-)

Oriane
 
Back
Top