Board index » delphi » ADO - Excel

ADO - Excel


2007-03-30 01:08:01 PM
delphi99
Hi all,
TD2006,
I am trying to import data from an Excel file, with OBDC - ADO.
My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC, etc)
and, in my program I try to mantain an ADOConnection and an ADOTable :
object ADOConnection1: TADOConnection
ConnectionString =
'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor' +
't excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
CursorLocation = clUseServer
Mode = cmReadWrite
Provider = 'MSDASQL.1'
Left = 352
Top = 104
end
object ADOTable1: TADOTable
Connection = ADOConnection1
TableDirect = True
Left = 512
Top = 96
end
In the ADOTable.TableName instance field I am supposed to get the names of
the Spreadsheets from the Excel Workbook. But I get none so my data import
does not work.
Any ideas ?
Tiberiu
--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2877 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
 
 

Re:ADO - Excel

Try to use MS Jet OLEDB provider:
ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=<file.xls>;Extended Properties=Excel 8.0';
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
следующе? news:460c9b29$XXXX@XXXXX.COM...
Quote
Hi all,

TD2006,

I am trying to import data from an Excel file, with OBDC - ADO.
My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC,
etc)
and, in my program I try to mantain an ADOConnection and an ADOTable :

object ADOConnection1: TADOConnection
ConnectionString =
'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor' +
't excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
CursorLocation = clUseServer
Mode = cmReadWrite
Provider = 'MSDASQL.1'
Left = 352
Top = 104
end
object ADOTable1: TADOTable
Connection = ADOConnection1
TableDirect = True
Left = 512
Top = 96
end


In the ADOTable.TableName instance field I am supposed to get the names of
the Spreadsheets from the Excel Workbook. But I get none so my data import
does not work.

Any ideas ?



Tiberiu



--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2877 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!


 

Re:ADO - Excel

Thank you for your answer.
Microsoft.Jet.OLEDB.4.0 can open only Access (mdb) databases. I have no MS
Excel installed on my Windows Xp Pro. So the problem remains ...
Tiberiu
"Vassiliev V. V." <XXXX@XXXXX.COM>writes
Quote
Try to use MS Jet OLEDB provider:

ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=<file.xls>;Extended Properties=Excel 8.0';

//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
следующе? news:460c9b29$XXXX@XXXXX.COM...
>Hi all,
>
>TD2006,
>
>I am trying to import data from an Excel file, with OBDC - ADO.
>My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC,
>etc)
>and, in my program I try to mantain an ADOConnection and an ADOTable :
>
>object ADOConnection1: TADOConnection
>ConnectionString =
>'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor' +
>'t excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
>CursorLocation = clUseServer
>Mode = cmReadWrite
>Provider = 'MSDASQL.1'
>Left = 352
>Top = 104
>end
>object ADOTable1: TADOTable
>Connection = ADOConnection1
>TableDirect = True
>Left = 512
>Top = 96
>end
>
>
>In the ADOTable.TableName instance field I am supposed to get the names
>of
>the Spreadsheets from the Excel Workbook. But I get none so my data
>import
>does not work.
>
>Any ideas ?
>
>
>
>Tiberiu
>
>
>
>--------------------------------------------------------------------------------
>I am using the free version of SPAMfighter for private users.
>It has removed 2877 spam emails to date.
>Paying users do not have this message in their emails.
>Try SPAMfighter for free now!
>
>


--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2926 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
 

Re:ADO - Excel

Microsoft.Jet.OLEDB.4.0 can open Access, Excel 3 - 2003, DBF, Paradox, Text
and HTML files. Look at "Extended Properties=Excel 8.0" in connection
string. Open Excel files with Microsoft.Jet.OLEDB.4.0 does not need Excel to
be installed.
//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
следующе? news:460d1c85$XXXX@XXXXX.COM...
Quote
Thank you for your answer.

Microsoft.Jet.OLEDB.4.0 can open only Access (mdb) databases. I have no MS
Excel installed on my Windows Xp Pro. So the problem remains ...


Tiberiu




"Vassiliev V. V." <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Try to use MS Jet OLEDB provider:
>
>ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
>Source=<file.xls>;Extended Properties=Excel 8.0';
>
>//------------------------------------------
>Regards,
>Vassiliev V. V.
>www.managed-vcl.com - using .Net objects in Delphi for Win32 +
>ADO.Net
>www.oledbdirect.com - The fastest way to access MS SQL Server,
>MS Jet (Access) and Interbase (through OLEDB)
>
>
>"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
>следующе? news:460c9b29$XXXX@XXXXX.COM...
>>Hi all,
>>
>>TD2006,
>>
>>I am trying to import data from an Excel file, with OBDC - ADO.
>>My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC,
>>etc)
>>and, in my program I try to mantain an ADOConnection and an ADOTable :
>>
>>object ADOConnection1: TADOConnection
>>ConnectionString =
>>'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor'
>>+
>>'t excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
>>CursorLocation = clUseServer
>>Mode = cmReadWrite
>>Provider = 'MSDASQL.1'
>>Left = 352
>>Top = 104
>>end
>>object ADOTable1: TADOTable
>>Connection = ADOConnection1
>>TableDirect = True
>>Left = 512
>>Top = 96
>>end
>>
>>
>>In the ADOTable.TableName instance field I am supposed to get the names
>>of
>>the Spreadsheets from the Excel Workbook. But I get none so my data
>>import
>>does not work.
>>
>>Any ideas ?
>>
>>
>>
>>Tiberiu
>>
>>
>>
>>--------------------------------------------------------------------------------
>>I am using the free version of SPAMfighter for private users.
>>It has removed 2877 spam emails to date.
>>Paying users do not have this message in their emails.
>>Try SPAMfighter for free now!
>>
>>
>
>

--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2926 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!


 

Re:ADO - Excel

Yes Sir,you are right !
Thank you !
Tiberiu
"Vassiliev V. V." <XXXX@XXXXX.COM>writes
Quote
Microsoft.Jet.OLEDB.4.0 can open Access, Excel 3 - 2003, DBF, Paradox,
Text and HTML files. Look at "Extended Properties=Excel 8.0" in connection
string. Open Excel files with Microsoft.Jet.OLEDB.4.0 does not need Excel
to be installed.

//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
следующе? news:460d1c85$XXXX@XXXXX.COM...
>Thank you for your answer.
>
>Microsoft.Jet.OLEDB.4.0 can open only Access (mdb) databases. I have no
>MS Excel installed on my Windows Xp Pro. So the problem remains ...
>
>
>Tiberiu
>
>
>
>
>"Vassiliev V. V." <XXXX@XXXXX.COM>writes
>news:XXXX@XXXXX.COM...
>>Try to use MS Jet OLEDB provider:
>>
>>ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
>>Source=<file.xls>;Extended Properties=Excel 8.0';
>>
>>//------------------------------------------
>>Regards,
>>Vassiliev V. V.
>>www.managed-vcl.com - using .Net objects in Delphi for Win32 +
>>ADO.Net
>>www.oledbdirect.com - The fastest way to access MS SQL Server,
>>MS Jet (Access) and Interbase (through OLEDB)
>>
>>
>>"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
>>следующе? news:460c9b29$XXXX@XXXXX.COM...
>>>Hi all,
>>>
>>>TD2006,
>>>
>>>I am trying to import data from an Excel file, with OBDC - ADO.
>>>My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC,
>>>etc)
>>>and, in my program I try to mantain an ADOConnection and an ADOTable :
>>>
>>>object ADOConnection1: TADOConnection
>>>ConnectionString =
>>>'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor'
>>>+
>>>'t excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
>>>CursorLocation = clUseServer
>>>Mode = cmReadWrite
>>>Provider = 'MSDASQL.1'
>>>Left = 352
>>>Top = 104
>>>end
>>>object ADOTable1: TADOTable
>>>Connection = ADOConnection1
>>>TableDirect = True
>>>Left = 512
>>>Top = 96
>>>end
>>>
>>>
>>>In the ADOTable.TableName instance field I am supposed to get the names
>>>of
>>>the Spreadsheets from the Excel Workbook. But I get none so my data
>>>import
>>>does not work.
>>>
>>>Any ideas ?
>>>
>>>
>>>
>>>Tiberiu
>>>
>>>
>>>
>>>--------------------------------------------------------------------------------
>>>I am using the free version of SPAMfighter for private users.
>>>It has removed 2877 spam emails to date.
>>>Paying users do not have this message in their emails.
>>>Try SPAMfighter for free now!
>>>
>>>
>>
>>
>
>--------------------------------------------------------------------------------
>I am using the free version of SPAMfighter for private users.
>It has removed 2926 spam emails to date.
>Paying users do not have this message in their emails.
>Try SPAMfighter for free now!
>
>


--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2926 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
 

Re:ADO - Excel

Works fine with Excel and DBF.
How can I open a MDB file with Microsoft.Jet.OLEDB.4.0 ?
Thank you in advance,
Tiberiu
"Vassiliev V. V." <XXXX@XXXXX.COM>writes
Quote
Try to use MS Jet OLEDB provider:

ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=<file.xls>;Extended Properties=Excel 8.0';

//------------------------------------------
Regards,
Vassiliev V. V.
www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)


"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
следующе? news:460c9b29$XXXX@XXXXX.COM...
>Hi all,
>
>TD2006,
>
>I am trying to import data from an Excel file, with OBDC - ADO.
>My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC,
>etc)
>and, in my program I try to mantain an ADOConnection and an ADOTable :
>
>object ADOConnection1: TADOConnection
>ConnectionString =
>'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor' +
>'t excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
>CursorLocation = clUseServer
>Mode = cmReadWrite
>Provider = 'MSDASQL.1'
>Left = 352
>Top = 104
>end
>object ADOTable1: TADOTable
>Connection = ADOConnection1
>TableDirect = True
>Left = 512
>Top = 96
>end
>
>
>In the ADOTable.TableName instance field I am supposed to get the names
>of
>the Spreadsheets from the Excel Workbook. But I get none so my data
>import
>does not work.
>
>Any ideas ?
>
>
>
>Tiberiu
>
>
>
>--------------------------------------------------------------------------------
>I am using the free version of SPAMfighter for private users.
>It has removed 2877 spam emails to date.
>Paying users do not have this message in their emails.
>Try SPAMfighter for free now!
>
>


--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2931 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!
 

Re:ADO - Excel

I try :
ADOConnection.ConnectionString :=
'Provider=Microsoft.Jet.OLEDB.4.0;Data Source='+FilenameEdit_in+';'+
'Mode=ReadWrite;Persist Security Info=False'
when I try
ADOConnection.Connected:=true;
then I get the error :
"Cannot start you application. The workgroup information file is missing or
opened exclusively by another user".
Tiberiu
"Tiberiu Horvath" <XXXX@XXXXX.COM>writes
Quote
Works fine with Excel and DBF.

How can I open a MDB file with Microsoft.Jet.OLEDB.4.0 ?


Thank you in advance,

Tiberiu


"Vassiliev V. V." <XXXX@XXXXX.COM>writes
news:XXXX@XXXXX.COM...
>Try to use MS Jet OLEDB provider:
>
>ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data
>Source=<file.xls>;Extended Properties=Excel 8.0';
>
>//------------------------------------------
>Regards,
>Vassiliev V. V.
>www.managed-vcl.com - using .Net objects in Delphi for Win32 +
>ADO.Net
>www.oledbdirect.com - The fastest way to access MS SQL Server,
>MS Jet (Access) and Interbase (through OLEDB)
>
>
>"Tiberiu Horvath" <XXXX@XXXXX.COM>сообщи?сообщила ?новостя?
>следующе? news:460c9b29$XXXX@XXXXX.COM...
>>Hi all,
>>
>>TD2006,
>>
>>I am trying to import data from an Excel file, with OBDC - ADO.
>>My ODBC connection uses an Excel 97 driver (Administrative Tools, ODBC,
>>etc)
>>and, in my program I try to mantain an ADOConnection and an ADOTable :
>>
>>object ADOConnection1: TADOConnection
>>ConnectionString =
>>'Provider=MSDASQL.1;Persist Security Info=False;Data Source=impor'
>>+
>>'t excel;Mode=ReadWrite;Initial Catalog=C:\TEMP\KEBO'
>>CursorLocation = clUseServer
>>Mode = cmReadWrite
>>Provider = 'MSDASQL.1'
>>Left = 352
>>Top = 104
>>end
>>object ADOTable1: TADOTable
>>Connection = ADOConnection1
>>TableDirect = True
>>Left = 512
>>Top = 96
>>end
>>
>>
>>In the ADOTable.TableName instance field I am supposed to get the names
>>of
>>the Spreadsheets from the Excel Workbook. But I get none so my data
>>import
>>does not work.
>>
>>Any ideas ?
>>
>>
>>
>>Tiberiu
>>
>>
>>
>>--------------------------------------------------------------------------------
>>I am using the free version of SPAMfighter for private users.
>>It has removed 2877 spam emails to date.
>>Paying users do not have this message in their emails.
>>Try SPAMfighter for free now!
>>
>>
>
>

--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2931 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!


--------------------------------------------------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 2931 spam emails to date.
Paying users do not have this message in their emails.
Try SPAMfighter for free now!