 |
|
 |
HI,
I ran the demo ReadExcel.exe directly on a seperate computer without visual studio 2010, OS win7. It is good. However, when i rebuild the program on another computer with visual studio 2010 and then ran it on a seperate computer again. An error message came out " The program can't start because mfc100.dll is missing from your computer. Try reinstalling the program to fix this problem."
Please help.
|
|
|
|
 |
|
|
 |
|
 |
Is it possible to use your approach without Excel being installed on the system?
|
|
|
|
 |
|
 |
I tried the project and it works fine.
But, if a long text (longer than 256 chars) is in the data field in excel, GetFieldValue() function returns truncated(256 bytes) text.
Is there anyway to support long data in the database?
Thanks,
|
|
|
|
 |
|
 |
Hi,
Please help me...
I want to fire a query against EXCEL sheet in Java servlet.
I have a EXCEL sheeet with ID & Name columns.
In Java I am getting some Name from user input and want associated ID.
Query I am using:
String query = "Select * from [Sheet1$] where [Name] like "
+"%"+search+"%";
where search is Java variable where I am getting user input.
It is giving me error
"java.sql.SQLException: [Microsoft][ODBC Excel Driver] Syntax error in query expression '[Name] like %vir%'. "
Please help me how can I use 'LIKE' operator for this query. Or any other workaround...
Thanks...
|
|
|
|
 |
|
 |
The line:
while (pszBuf[1] != '\0');
must be:
while (pszBuf[0] != '\0');
Joe
|
|
|
|
 |
|
 |
Have a large file that exceeds the number of rows in EXCEL and would like to write the files to ACCESS instead. Any ideas?
|
|
|
|
 |
|
 |
Hi,
the executable runs fine but when I compile the project and try to run it I get the following error message :
"Database error : The Microsoft Jet database engine could not find the object "demo_table". Make sure the object exists and that you spell its name ant the path name correctly."
What could it be? My version of Office?
Thanks,
Francis
|
|
|
|
 |
|
 |
just include ReadExcel.xls in the working exe folder
|
|
|
|
 |
|
 |
I want to read data from excel sheet. I make two text box in my form name txtBEG and txtEND. I want to retrieve all dates between the begining date and end date whatever the user types in that text boxes. The connection is showing well. but I am facing lot of problem in it. I dont know why?
Everytime its showing an error messge "DataType mismatch" and the cursor is going to the data reader. can any one help me please in this regard by correcting the code.
***In my excel sheet i created the date field in date format like this 3/14/01(4th item in Type list box) and the excel is read only.
***I think the values are not converting in datetime value which the excel generates. Help me on this issue and correct the code please.....
My Code is Given below
------------------------
private void cmdTransferData_Click(object sender, EventArgs e)
//====================================================
{
Read_Excel(txtBEG.Text, txtEND.Text)
}
private void Read_Excel(string begDate_In,string endDate_In)
//===============================================
{
string strConn = "";
string pstrPassword = "";
string pstrFileName = "";
pstrFileName= "C:/TransRef.xls";
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Jet OLEDB:Database Password=" + pstrPassword +
"; " + "Data Source= " + pstrFileName + "; " +
"Extended Properties=Excel 8.0;"; //+
DateTimeFormatInfo dtF = new CultureInfo("en-US", +
false).DateTimeFormat;
string pstrFROM, pstrFIELDS, pstrWHERE;
string pstrSQL = ""; Boolean blnOrderBy = false;
pstrFROM = "FROM [TRANSREF$] ";
pstrFIELDS = "TD ";
pstrWHERE = "WHERE TD >= '" + (DateTime.Parse(begDate_In)).ToString("d", dtF) + "' and TD <= '" + DateTime.Parse(endDate_In).ToString("d", dtF) + "' ";
pstrSQL = "SELECT " + pstrFIELDS + pstrFROM +
pstrWHERE;
OleDbCommand myCommand = new OleDbCommand(pstrSQL);
OleDbConnection myConnection = new OleDbConnection
(strConn);
myConnection.Open();
myCommand.Connection = myConnection;
OleDbDataReader myReader = myCommand.ExecuteReader();
int pCountRec = 0;
string pRowVal = "";
while (myReader.Read())
{
pCountRec = pCountRec + 1;
pRowVal = myReader["TD"].ToString();
MessageBox.Show(pRowVal);
}
myConnection.Close();
}
|
|
|
|
 |
|
 |
I ha ve more than three rows , this program reads only 3 rows.
|
|
|
|
 |
|
 |
Yes, I Have the same problem , please help us.
Excel Formating problem .?!. or C++ Code Problem..?!
|
|
|
|
 |
|
 |
This program reads only records that were written using program from article "http://www.codeproject.com/KB/database/excel_odbc_write.aspx". If you make any changes of content it doesn't change written data.
|
|
|
|
 |
|
 |
hi,
i wrote a project that takes data from database and saves it as an excel document. i tried to run the project on different computer but without giving any error, it stops running. i copied all the dll files and i have the same framework that i compiled the project.
is there any way to deploy an office 2000 project?
thanks for your concern.
|
|
|
|
 |
|
 |
You mention in your article, that you canot read from az excel file without some formatting.
I found this atrticle wich shows how to do this without formatting.
The link to this article is:
http://www.idude.net/excel/articles/using_excel_file_datasources.asp
The info from the article:
<<
There are a number of ways you can reference a table (or range) in an Excel workbook:
* Workbook Name
Use the Workbook Name followed by a dollar sign (for example, [Sheet1$] or [My Workbook$]).
A Workbook table that is referenced in this manner consists of the entire used range of the Workbook.
"Select [column_names] from [Sheet1$]"
* Cell Range
Use the Workbook Name followed by a dollar sign with cell range appended to it! Don't forget to use the colon : between the starting and ending cell positions!
"Select [column_names] from [Sheet1$A1:B10]"
* Named Range
This is a range of cells with a defined name
"Select [column_names] from [Defined Name Range]"
>>
For more info, read the entire article
|
|
|
|
 |
|
 |
Hi Everyone,
I've been a member for sometime now and have been reading a few things on this forum. This is the first time that I'm posting a request. Hope you all gurus will respond.
I want to read/write MS excel sheets on Unix/solaris platform using C++.
I did go through the article posted by Alexander Mikula on how to use ODBC and read excel sheets using CRecordset.
But I'm not sure how to use ODBC connection in Unix/solaris.
Please tell me ways to do it unix using C++.
Thanks.
Tanz.
|
|
|
|
 |
|
 |
Unix?
If Microsoft wanted to make their formats available (easily) to everyone no matter what platform they where on, they would have simply made it the easy way... That is, suppling an easy cross platform c/c++-api that you could link into your project.
I think its pretty obvious (with the excel-driver approach) that they don't want you to even consider using anything else than windows. (they also want you to pony up the dough for Microsoft(c) Office[tm])
Sorry for the one year late reply, I'm just very frustated that this sort of crap is allowed.
|
|
|
|
 |
|
 |
I want to use SQL SELECT statement: Select * form demo_table where field_2 = ’†‘; but is doesn't support chinese
|
|
|
|
 |
|
 |
Hello,
i try, but it don't works.
I get an Error:
"Database error: The Micosoft Jet-Databasemodul couldt not find the 'demo_table' Object."
The App open the File correctly, but the Worksheet fails.
WHY ???
MfG
BK
|
|
|
|
 |
|
 |
I need a program which can read more than 2 columns, but when i try adding to: sSq1= "SELECT Field1, Field2 FROM [Sheet1$]", it can only take Field1 and Field2. When I try adding a thrid one in... it just won't work. Can someone please help me with this?
hellie
|
|
|
|
 |
|
 |
I found out a method of how to use more than one column in the program. I am not sure if it is the official way to do it, but it works on my program so... here it is:
sSq1= "SELECT * FROM [Sheet1$]"
recset.Open(CRecordset::forwardOnly,sSql,CRecordset::readOnly);
recset.GetFieldValue("Field1",1);
recset.GetFieldValue("Field2",2);
recset.GetFieldValue("Field3",3);
hellie
|
|
|
|
 |
|
 |
This program reads only data that were written with program from article "http://www.codeproject.com/KB/database/excel_odbc_write.aspx"
The table name for reading must correspond the table name in that programm. You can't change neighter name of written table nor any data from editor - only by writing program.
|
|
|
|
 |
|
 |
Alexander:
I tried to run your demo readExcel on my PC and got an error message
" Database error: Specified driver could not be loaded due to system error 182{Microsoft Excel Driver [*.xls}} "
I don't know what that means, could you help?
Tina
|
|
|
|
 |
|
 |
When I read the FAQ's on these articles, the biggest problems seems to be the tables names. How can I know the table (sheetname) is demo_table?
To provide a list of all tables/sheet in an excelfile, simply use the class CTable from the Microsoft DBFetch sample. (this sample project is on your visual C++ CD).
With this table you can generate a list of all the tables in an excelfile.
|
|
|
|
 |
|
 |
I tried using the CTable class, but the class did not return any table names.
I did not receive any error messages. The program returned EOF(), when I tried to iterate through the tables (my spreadsheet has data).
Curiously, I tried "Sheet1" for the table name (which is the name at the bottom of the spreadsheet) and that did not work either.
Jacques
|
|
|
|
 |