 |
|
|
 |
|
 |
I need to input long text string into the data field. And I specified the field size as in : sSql = "CREATE TABLE demo (Name TEXT(1024),Age NUMBER)";
But when the application runs, database exception occurs. "Database error: Size of field 'Name' is too long." It is OK when I put 256 or less.
How can I create a table with field longer than 256 bytes?
Thanks,
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi Can anybody help me in using this code to write into multiple worksheets of the same excel file. for example DataTable1 to Sheet1 and DataTable2 to Sheet2.
Thanks in advance Ganapatsa
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
 |
|
 |
Hello,
I have some rather unique constraints here... I have'export to xls' functionality, which is working (thank you everyone who has posted help online for C++ and ADO)
my issue is, I also need to 'view the inserts in real time' in the excel sheet. The 'Operator' presses a button (transmitted serially and parsed in a CPP app) and wants to 'see' the entry in the open Excel sheet immediately.
Of course, doing this now I get the eror "cannot expand named range".
If anyone could help that would be awesome.
Chris
|
| Sign In·View Thread·PermaLink | 1.00/5 (3 votes) |
|
|
|
 |
|
 |
Hello!
I tried to create an access file using the same principle i.e., by changing
CString sDriver = "MICROSOFT EXCEL DRIVER (*.XLS)"; to CString sDriver = "MICROSOFT ACCESS DRIVER (*.MDB)";
and CString sExcelFile = "c:\\demo.xls"; to CString sExcelFile = "c:\\demo.mdb";
without changing other things.
I was unsuccessful to create the file! Is there any other requirement to create an access file?
Thanks.
-- modified at 0:05 Friday 29th December, 2006
|
| Sign In·View Thread·PermaLink | 2.20/5 (2 votes) |
|
|
|
 |
|
 |
<script runat="server"></script> <script language="VBScript"></script> <%%> Three script are there.which one first,second and last execute please tell me
sambath kumar.E
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Using INSERT INTO We can give only direct values to the columns.. But if we want to give values using variable names means what to do..? I tried a lot. but its not working.
sSql = "INSERT INTO demo (NET_NAME,DUT_PIN,TESTER_CHANNEL,TOLERANCE,LAYER_NO,TRACK_WIDTH) VALUES ('DGND','SITE.Y17','121.CH14',43,3,2)"; database.ExecuteSQL(sSql); In this, i have to pass the variable name for VALUES instead of giving as 'DGND' and so on.. Because i knew the values for the corresponding columns only during the run time.
Sangeetha.
|
| Sign In·View Thread·PermaLink | 2.00/5 (3 votes) |
|
|
|
 |
|
 |
I got an error in excel [Microsoft][ODBC Excel Driver] the connection for viewing your linked Microsoft excel Worksheet was lost
what should i do?
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
|
 |
|
 |
You can modify the code to insert more than one table in the same excel file
void CtestDlg::OnBnClickedCreateExcel() { CDatabase database; CString sDriver = "MICROSOFT EXCEL DRIVER (*.XLS)"; // exactly the same name as in the ODBC-Manager
CString sExcelFile = "c:\\demo.xls"; // Filename and path for the file to be created
CString sSql; TRY { // Build the creation string for access without DSN sSql.Format("DRIVER={%s};DSN='';FIRSTROWHASNAMES=1;READONLY=FALSE;CREATE_DB=\"%s\";DBQ=%s", sDriver, sExcelFile, sExcelFile);
// Create the database (i.e. Excel sheet)
if( database.OpenEx(sSql,CDatabase::noOdbcDialog) ) { // Create table structure
sSql = "CREATE TABLE demo (Name TEXT,Age NUMBER)"; database.ExecuteSQL(sSql);
// Insert data
sSql = "INSERT INTO demo (Name,Age) VALUES ('Bruno Brutalinsky',45)"; database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Fritz Pappenheimer',30)"; database.ExecuteSQL(sSql);
sSql = "INSERT INTO demo (Name,Age) VALUES ('Hella Wahnsinn',28)"; database.ExecuteSQL(sSql);
// Create new table
sSql = "CREATE TABLE NewTable (Job TEXT,Salary NUMBER)"; database.ExecuteSQL(sSql); sSql = "INSERT INTO NewTable (Job , Salary) VALUES ('Secretary',45)"; database.ExecuteSQL(sSql);
sSql = "INSERT INTO NewTable (Job , Salary) VALUES ('Programmer',45)"; database.ExecuteSQL(sSql);
sSql = "INSERT INTO NewTable (Job , Salary) VALUES ('Manager',45)"; database.ExecuteSQL(sSql);
}
// Close database database.Close(); } CATCH_ALL(e) { TRACE1("Driver not installed: %s",sDriver); } END_CATCH_ALL; } I hope this is helpful!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
 Hi, I want to change the font style i.e. headers with bold and change some colors in the data tables (columns or rows) depending on the value. I dont know whether this can be done or not. Please guide me as i have not used excel before. I have to use MFC and i have excel 2003. Looking forward to a response. Thanks a lot in advance.
Regards,
Himnanshu
|
| Sign In·View Thread·PermaLink | 1.50/5 (4 votes) |
|
|
|
 |
|
 |
This works in JET[Access] but not in mySQL
SELECT * INTO [foo] IN foo.xls 'Excel 8.0;' FROM [footable];
One line is so much easier...sigh...
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Because it doesn´t work?
I tried it and got "wrong Syntax near keyword IN"
what is wrong with this statement? Would be very nice!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have to ditribute a program that uses the ODBC Excel driver. How can I check if ODBC and the driver are installed on the target machine? If ODBC is not installed, how can I install it? Can I do this with InstallShield?
Thanks
Gianluca Nastasi
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
 |
Start odbcad32.exe to check what ODBC drivers are installed. The ODBC Excel driver is part of the Excel Installation.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I was, in part, inspired by this code to write a similar example in plain C (no C++, MFC, etc).
The example supports writing to and reading from excel workbooks using the ODBC Excel Driver.
I came up with this method of having a pseudo auto number field (assuming the demo table has an ID field). "INSERT INTO [demo$] (ID,Name,Age) SELECT IIf( IsNull( MAX(ID) ),0,MAX(ID) + 1) AS newID, 'A Name' AS newName,33 AS newAge FROM [demo$]"
I also found that altering a workbook that was open in Excel would cause a crash or have other undesirable consequences. To this end, I included an isFileOpen function in the sample to prevent an open Excel file being altered.
Finally, the sample demonstrates how to ignore the 'This table already exists...' error.
The code can be found in zip form on this page under the name OdbcExcl: ODBC Excel Sample in Plain C[^]
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Where is that code? I have looked all over. I will appreciate if you could send to me. ahmedshujaa@hotmail.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |