Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default SQL - Insert from Excel HELP!

So? What happened when you tried it?

This is going onto a SQL Server Db


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot insert worksheet in exel - not available in insert menu pedro39 Excel Worksheet Functions 1 July 24th 08 12:09 PM
insert row / insert column command buttons fairgreen Excel Worksheet Functions 1 October 29th 07 02:41 PM
unable to insert columns in excel, insert- columns (disabled) iam_leearner Excel Discussion (Misc queries) 1 August 13th 06 02:26 PM
Macro to insert copy and insert formulas only to next blank row bob Excel Programming 0 June 30th 06 12:02 PM
Insert cell/format/text/fontsize and auto insert into header? Unfurltheflag Excel Programming 2 November 3rd 04 05:39 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"