Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old February 9th, 2005, 01:00 PM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi everyone,

I am tryin to query a column using Microsoft's text writer. The column in my query is :

# The daily noon exchange rates for major foreign currencies are published every business day at about

how do I include this column in my query? quotes, brackets.

Thanke for the help

Reply With Quote
  #12 (permalink)  
Old February 11th, 2005, 02:05 PM
Registered User
 
Join Date: Feb 2005
Location: Seattle, WA, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SKClay
Default

Well, I changed the application so I could connect the linked server to a directory on a local drive, and everything works great from Query Analyzer... but when I run it from the web application, I get a vague error "OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error." I've given full permissions to the directory to everyone, thinking it might be a security access issue, but that didn't help.. any Ideas?
Thanks ...

(original post)
This works great for files on the local machine, thanks for the code.  I have a situation where I would like to point to a directory on a different server, so I tried in the data source \\servername\dir\subdir
but havent had any success... have you done this sort of connection before?   I have to mess with the security settings to get it to not error out, but even when there are no errors, the Tables section is empty...

if you have done this, could you explain the security settings you used on the Linked Server properties, plus the security settings for the directory you link to...

thanks..

Quote:
quote:Originally posted by pgtips
 Thought I may as well post how to do the linked server set-up...

From Enterprise Manager:
 Security > Linked Servers > New Linked Server
 General tab inputs:
 Linked Server : type anything, e.g. TEXTTEST
 Server type - click 'other data source'
 Provider : choose Microsoft Jet 4.0 OLEDB Provider
 Product Name : leave blank
 Data Source : type in the directory, e.g. C:\Temp
 Provider String : type in Text;HDR=No;FMT=Delimited

 leave other tabs with default values

 then SQL becomes:
Code:
SELECT hst.PartNumber, lt.F1 
FROM hawker.Summarytest hst
INNER JOIN 
TEXTTEST...LSPRINT#TXT lt
ON hst.PartNumber = lt.F1
Reply With Quote
  #13 (permalink)  
Old February 21st, 2005, 02:02 PM
Registered User
 
Join Date: Feb 2005
Location: Seattle, WA, .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to SKClay
Default

Well, banging my head against the problem long enough finally led me to the solution.

Microsoft articles http://support.microsoft.com/default...b;en-us;814398 and http://support.microsoft.com/default...b;en-us;296711, discuss problems with the Jet engine. My difficulty arose from the vagueness of the error I got, no error number or file locations...

Appearantly, Jet creates a temporary file dsn for the file being accessed through the Linked Server.

Here's the wonderful part, it creates it in the directory referenced by the Environmental Variable "Temp" or "TMP", <em>for the user account that the SQL service runs under</em>...After finding the directory and assigning appropriate rights, the application worked beautifully...

now, after wasting 2 days of running around in circles, I can get to doing some actual work :)

Sam
Quote:
quote:Originally posted by SKClay
 Well, I changed the application so I could connect the linked server to a directory on a local drive, and everything works great from Query Analyzer... but when I run it from the web application, I get a vague error "OLE DB provider 'Microsoft.Jet.OLEDB.4.0' reported an error."  I've given full permissions to the directory to everyone, thinking it might be a security access issue, but that didn't help..   any Ideas?
Thanks ...

Reply With Quote
  #14 (permalink)  
Old December 16th, 2005, 12:30 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having the same problem with CSV file. It gets the numerical data and does not get the string data. I wanted to ask if you got any solution working.
thanks

Quote:
quote:Originally posted by Ziv
 When I use this connection method, I am only receiving numerical data and none of the string text from the CSV file.
Any ideas on why this would be happening?

I am using the code from:
http://www.danielklann.com/excel/imp...files_into.htm

Thank you for your help,
Ziv
Reply With Quote
  #15 (permalink)  
Old December 19th, 2005, 04:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi ajimi,

Sounds like there are problems interpreting the data. Try creating a schema.ini to define exactly what is in your text file. Here's a link with an easy way to create one...
http://p2p.wrox.com/topic.asp?TOPIC_ID=25011

hth
Phil
Reply With Quote
  #16 (permalink)  
Old December 20th, 2005, 05:12 PM
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually I have an asp page that will read any CSV file, retrieve the data and display on the page and then insert into the SQL database. I cannot use schema.ini as I'm not sure about the format of CSV files to be read. It can have any format. I just have to read "Mailing Address" Fields record by record. Right now the problem is I cannot read zip code field correctly especially if the field has both 5 and 9 digit zip codes. Either it reads a 5 digit or 9 digit zips depending on which one in majority and ignores the other one. Do you have any clue how to resolve this problem?

thanks
ajimi

Quote:
quote:Originally posted by pgtips
 Hi ajimi,

Sounds like there are problems interpreting the data.  Try creating a schema.ini to define exactly what is in your text file.  Here's a link with an easy way to create one...
http://p2p.wrox.com/topic.asp?TOPIC_ID=25011

hth
Phil
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
ODBC Microsoft Access Driver Issue mat41 Classic ASP Professional 5 June 30th, 2008 10:37 AM
Microsoft Excel Driver Error cancer10 Classic ASP Databases 0 January 23rd, 2007 05:42 AM
Microsoft Text Driver and ADODB ? x23 MySQL 3 February 15th, 2005 04:27 PM
[Microsoft][ODBC Microsoft Access Driver] Syntax e chinedu Classic ASP Databases 3 November 18th, 2004 02:48 PM
Microsoft Text Driver ??? x23 SQL Server ASP 0 November 5th, 2004 04:54 AM



All times are GMT -4. The time now is 10:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.