] ]

 
] ] ]
]
Top 5 Recent Posts ]
View Last Post CF developer East Sussex needed
Last Post By: Guests
Forum: Employers

Posted: 10 August 2010 at: 6:06pm

View Last Post Related selects using bind and cfc
Last Post By: Oyster
Forum: Coldfusion Programming

Posted: 01 July 2010 at: 6:18pm

View Last Post Table layout query
Last Post By: Clarkee21
Forum: HOW TO

Posted: 22 June 2010 at: 3:15pm

View Last Post CF developer required Immediately
Last Post By: jeromesmith
Forum: Employers

Posted: 25 May 2010 at: 8:53am

View Last Post ColdFusion Developer- 9 Month Contract
Last Post By: Ryanadams100
Forum: Employers

Posted: 21 April 2010 at: 4:18pm

]
] ]

] ] ]
]
Welcome Guest ]
Name:
Pass:
Auto Login
Add me to Active Users list
Yes  No

Forgot password? | Register
]
] ]

] ] ]
]
Online Activity ]
People Online: 10
Guest(s): 10
Member(s): 0
Memberships: 2472
The Newest Member is patidarvijay
Most Online: 60
Occured: 22 October 2009
Members[0], Guests[60]
]
] ]

] ] ]
]
Member(s) Visited ]
Total: 0 
No matches found
]
] ]

   
Coldfusion Programming
 CFDeveloper - Coldfusion developer community » Coldfusion Programming
Subject Topic: Cf upload to SQL Server 2000 Post ReplyPost New Topic
Forum Jump  
] ] ]
]
Author
Message Prev Topic | Next Topic 
Oyster
Senior Member
Avatar

Senior Member

Joined: 18 March 2005
National Flag of United States United States
Posts: 190
Gender: Female
Posted: 23 September 2009 at 8:22pm | IP Logged Quote Oyster

I'm trying to figure out how to import an excel spreadsheet into a table within a SQL Server database.  Searching on the internet, I found this:

select * 
into SQLServerTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 
    'Excel 8.0;Database=D:\testing.xls;HDR=YES', 
    'SELECT * FROM [Sheet1$]')
I just slapped this code into a cf page, changed the 
table name, and the location and name of the spreadsheet,
and tried it out.
It bombs at the "From" clause. "Incorrect syntax near the
keyword 'from'. Here's my statement:



<cfquery name="insert" datasource="jeffy">
insert into jefftable from openrowset('Microsoft.Jet.OLEDB.4.0',
    'Excel 8.0;Database=C:\dothis.xls;HDR=YES',
    'SELECT * FROM [Sheet1$]');
</cfquery>

I have no clue what I'm doing, so any help or suggestions 
will be appreciated.
 


__________________
Si hoc legere scis, nimium eruditionis habes.
Back to Top Printable version View Oyster's Profile Search for other posts by Oyster
 
Paulk
Newbie
Avatar

Newbie

Joined: 31 December 2008
National Flag of United States United States
Posts: 19
Gender: Male
Posted: 23 September 2009 at 8:57pm | IP Logged Quote Paulk

It would be much easier to use the Excel import tools.  Use the Enterprise manager tool that comes with SQL server to import form xls document.

Or save the xl file as csv and import it that way.
Back to Top Printable version View Paulk's Profile Search for other posts by Paulk Visit Paulk's Homepage
 
Paulk
Newbie
Avatar

Newbie

Joined: 31 December 2008
National Flag of United States United States
Posts: 19
Gender: Male
Posted: 23 September 2009 at 11:44pm | IP Logged Quote Paulk

Also take a look at this post this might be your issue:  http://blog.cfcentral.com.au/post.cfm/reading-excel-spreadsh eets
Back to Top Printable version View Paulk's Profile Search for other posts by Paulk Visit Paulk's Homepage
 
Oyster
Senior Member
Avatar

Senior Member

Joined: 18 March 2005
National Flag of United States United States
Posts: 190
Gender: Female
Posted: 24 September 2009 at 2:04pm | IP Logged Quote Oyster

Thanks PaulK,

But I can't seem to get around my previously mentioned error message regarding the "From" clause.  I did look at the link you suggested, but unfortunately it didn't tell me anything more than what I already know.  If you have any other ideas, I'd love to hear them.

Thanks again 



__________________
Si hoc legere scis, nimium eruditionis habes.
Back to Top Printable version View Oyster's Profile Search for other posts by Oyster
 
Russ
Admin Group
Avatar

Admin Group
Snake

Joined: 23 January 2005
National Flag of United Kingdom United Kingdom
Posts: 633
Gender: Male
Posted: 04 October 2009 at 12:29pm | IP Logged Quote Russ

perhaps this might help you

 

http://www.bennadel.com/blog/472-Reading-Excel-Files-With-Co ldFusion-And-POI.htm



__________________
Russ Michaels
CFDeveloper Administrator
my blog: <a href="http://russ.michaels.me.uk/">russ.michaels.me.uk< ;/a>
Back to Top Printable version View Russ's Profile Search for other posts by Russ Visit Russ's Homepage
 
]
] ]
Forum Jump  

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic

] ] ]
]
  ]
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum
]
] ]

] ] ]
]
This page was generated in 0.9365 seconds. ©2004 cfdeveloper.co.uk
]
] ]