Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 14th, 2006, 01:00 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default incorrect syntax near 'DATA'

I just moved an asp/mysql site over to a new windows server and converted to an mssql database. I have changed the paths in my files and reuploaded all necessary database info and all appears to be working fine, except for when I try to execute a few certain SQL statements. Below is the error I get:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'DATA'.

/ap2336519589/admin/report_upload_action.asp, line 144

Now I know this means something is wrong with my MSSQL statement in my asp so here is my asp (I would like to point out this was in perfect working order on the previous server)

Code:
SQL="LOAD DATA INFILE 'd:/inetpub/virtual/ap2336519589/WWWROOT/data/other/031990.TXT' INTO TABLE weekly_report FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '""' LINES TERMINATED BY '\r\n'"
Set RSSQL = MyConn.Execute(SQL)
That .TXT file exists as far as I can because I type in the http address of the file and it works just fine.

Any help is appreciated.


 
Old December 14th, 2006, 02:10 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I think load data infile can only be executed on the MySQL server itself and not remotely.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 14th, 2006, 03:27 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there any equivalent command that I can use or a workaround for this?

 
Old December 14th, 2006, 04:35 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

No, i don't believe so. Unlike is MSSQL server where you can call a DTS via a Stored Procedure and import a text file that way, i know of no way to do the equivelant in MySQL. Check out www.mysql.com and see if they can help you further.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old December 14th, 2006, 04:41 PM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

BULK INSERT

http://msdn.microsoft.com/library/de...ba-bz_4fec.asp

Is that what I'm looking for?

 
Old December 15th, 2006, 10:09 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can not use MS T-SQL code with MySQL. While both MSSQL Server and MySQL understand SQL, they both implement it differently. And I have never used the BULK INSERT method to insert vast amounts of data into a datatable, I use DTS Process's to pull in a text file and transform the data as needed and send that data off to the necessary tables.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect syntax near '.' meraj ADO.NET 6 February 27th, 2012 01:01 AM
Incorrect syntax near 'FULLTEXT'? Ron Howerton SQL Server 2005 5 August 30th, 2006 03:39 PM
Incorrect syntax near '!' sinapra Classic ASP Databases 8 August 25th, 2004 02:15 AM
Incorrect syntax near '`' Hez Classic ASP Databases 3 August 5th, 2004 08:13 AM
Incorrect syntax...... Adam H-W Classic ASP Databases 8 June 21st, 2004 11:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.