Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL - Insert from Excel HELP!
I fianlly got the connecton. now i am trying to insert data.
What is wrong with the SQL? INSERT INTO rpt_NewLoanMonitor SELECT * FROM [DataSource] IN 'C:\Working Files\SQL_Scheduler.xls' 'Excel 8.0;' It says there is a problem near the keyword IN ... Thanks in advance Candyman |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL - Insert from Excel HELP!
This is going onto a SQL Server Db
"Candyman" wrote: I fianlly got the connecton. now i am trying to insert data. What is wrong with the SQL? INSERT INTO rpt_NewLoanMonitor SELECT * FROM [DataSource] IN 'C:\Working Files\SQL_Scheduler.xls' 'Excel 8.0;' It says there is a problem near the keyword IN ... Thanks in advance Candyman |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL - Insert from Excel HELP!
Long shot: Add keyword values and swap out spaces in the path with
%20. Try: INSERT INTO rpt_NewLoanMonitor VALUES SELECT * FROM [DataSource] IN 'C: \Working%20Files\SQL_Scheduler.xls' 'Excel 8.0;' Even if the syntax is OK the statement won't work if the number of columns in rpt_NewLoanMonitor doesn't equal the number of columns in SQL_Scheduler.xls. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL - Insert from Excel HELP!
So? What happened when you tried it?
This is going onto a SQL Server Db |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL - Insert from Excel HELP!
I'll have to give it a try tomorrow am. Points to ponder
1) the columns are the same as i just built the table and added one record of data from the excel spreadsheet. (created an insert statement using the cell values from excel) 2) I was wondering if it had anything to do with the last of the line "... Scheduler.xls' 'Excel 8.0;' " There is no divider between the file name and 'Excel 8.0'. 3) If a data field is a smalldatetime data type, should the excel cell be officailly formatted to date at least? Or would this nessitate creating a record set of some sort. and programatically formatiing anything that isdate(cell.value) = true to be a date to a date? 4) what would be the fastest way to extract the actual statement being passed to SQL Servrer? 5) I tried using [DataSource] refering to a range name. the name was built by setting the currentregion.name to "DataSource". should the reference in the Sql statement be...["DataSource"] instead? I really appresiate your input on this. thanks again candyman " wrote: Long shot: Add keyword values and swap out spaces in the path with %20. Try: INSERT INTO rpt_NewLoanMonitor VALUES SELECT * FROM [DataSource] IN 'C: \Working%20Files\SQL_Scheduler.xls' 'Excel 8.0;' Even if the syntax is OK the statement won't work if the number of columns in rpt_NewLoanMonitor doesn't equal the number of columns in SQL_Scheduler.xls. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cannot insert worksheet in exel - not available in insert menu | Excel Worksheet Functions | |||
insert row / insert column command buttons | Excel Worksheet Functions | |||
unable to insert columns in excel, insert- columns (disabled) | Excel Discussion (Misc queries) | |||
Macro to insert copy and insert formulas only to next blank row | Excel Programming | |||
Insert cell/format/text/fontsize and auto insert into header? | Excel Programming |