473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Different behaviours on different servers

S
I have a database and an application in .net using it.
In that database I have a stored procedure where is an import mechaism using
ODBC driver [Microsoft Text Driver (*.txt; *.csv)] and a .csv file.

On my machine everything works fine, but on the other machine import fails
with an exception

Could not execute query against OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: [Microsoft][ODBC Text Driver] Too few
parameters. Expected 6.]

My query looks like that:

DECLARE @TSQL varchar(8000)

SET @TSQL = 'INSERT INTO TABLE ( col1, col2, col3 )
SELECT * FROM OPENROWSET(''MSDASQL'', ''Driver={Microsoft Text Driver
(*.txt; *.csv)};DefaultDir='+@import_dir_path+';'', ''select COL1, COL2,
COL3 from '+@filename+''')'

EXEC (@TSQL)
SELECT @Err = @@ERROR, @Rct = @@ROWCOUNT

Second error I get:
My location is Polish but my national chars do not pass through other ODBC
driver - for dbf s.
Database was simply detached and atached, so collation hasn't changed.

First machine (the good one) works under WinNTWkst4.0 Polish version with
SP6 and ODBC Drivers version 4.00.5303

Second machine (the bad one) works under Win2kServer Eng with MDAC 2.7.
ODBC Drivers version 4.00.4200.
If anyone can help me - please do that! I'm frustrated to the limit
already...

Regards,
Sliver

Jul 20 '05 #1
3 3300

"S" <sl******@poczta.onet.pl> wrote in message
news:ca**********@nemesis.news.tpi.pl...
I have a database and an application in .net using it.
In that database I have a stored procedure where is an import mechaism using ODBC driver [Microsoft Text Driver (*.txt; *.csv)] and a .csv file.

On my machine everything works fine, but on the other machine import fails
with an exception

Could not execute query against OLE DB provider 'MSDASQL'.
[OLE/DB provider returned message: [Microsoft][ODBC Text Driver] Too few
parameters. Expected 6.]

My query looks like that:

DECLARE @TSQL varchar(8000)

SET @TSQL = 'INSERT INTO TABLE ( col1, col2, col3 )
SELECT * FROM OPENROWSET(''MSDASQL'', ''Driver={Microsoft Text Driver
(*.txt; *.csv)};DefaultDir='+@import_dir_path+';'', ''select COL1, COL2,
COL3 from '+@filename+''')'

EXEC (@TSQL)
SELECT @Err = @@ERROR, @Rct = @@ROWCOUNT

Second error I get:
My location is Polish but my national chars do not pass through other ODBC
driver - for dbf s.
Database was simply detached and atached, so collation hasn't changed.

First machine (the good one) works under WinNTWkst4.0 Polish version with
SP6 and ODBC Drivers version 4.00.5303

Second machine (the bad one) works under Win2kServer Eng with MDAC 2.7.
ODBC Drivers version 4.00.4200.
If anyone can help me - please do that! I'm frustrated to the limit
already...

Regards,
Sliver


I don't really have a good answer, but one possible issue is that the ODBC
drivers are different versions, and the one which doesn't work seems to be
older, so you might want to install the latest MDAC drivers (2.8, I think),
to see if that helps.

As an alternative, you could try using the Jet driver instead:

http://www.users.drew.edu/skass/sql/TextDriver.htm

Simon
Jul 20 '05 #2
S
> I don't really have a good answer, but one possible issue is that the ODBC
drivers are different versions, and the one which doesn't work seems to be
older, so you might want to install the latest MDAC drivers (2.8, I think), to see if that helps.
Thanks for answer - but it doesn't seams to be because of different vers. of
ODBC drvs - I've been so desperated that I installed on the fresh machine
win2kSrv with a 2kEnt database, set a patch on it and then mdac 2.8 - but
between all changes I'd been verifing if my query works. Laugh if you want
to - it was working even on fresh db - without any upgrade - and hadn't stop
after upgrades had been set up.
ODBC drivers versions are now the same as on the bad one machine ....

So - I have no idea what can be wrong. Is there anything like national
versions of ODBC drivers???
As an alternative, you could try using the Jet driver instead:
http://www.users.drew.edu/skass/sql/TextDriver.htm


It is good idea - but remember of the second problem - chars of my national
my charset aren't served properly... and the files are dbf... I have them
done through a linked server - but still the ODBC driver seems to be a
failure...

S.
Jul 20 '05 #3
Just a hunch, but I would keep looking down the route of MDAC. We had
a problem with insufficient parameters a while back. From what I
remember later versions of MDAC included an additional parameter to
the connection string when opening a database through an ODBC
connection. It would store this depending on the PC which created the
connection. We found this with a DTS package.

We could create a connection within a DTS package and then use in on
another server (ran as scheduled) which had a lower version which
would then not run. You may be able to test by re-creating the
connection on the version with the lower version so it doesn't include
this additional parameter and it may work. If it does, then I would
suggest a version issue which needs addressing.

As I say, it's a hunch as it's a little while since I looked at it,
but it may be of help to you.

We upgraded each PC and server to the same version of MDAC (2.8) to
get rid or the problem.

HTH

Ryan
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
4
by: Dave | last post by:
Hi, I tried something with 'return value' of a function and i got two different behaviours. My question is: why does method 1 not work? Thanks Dave method 1: here, whatever i choose (ok or...
0
by: Ken Durden | last post by:
I'm working on a client-server application where the client is controlling two devices (aka servers) which both implement the same interface contract. We have a set of about 4 assemblies which...
1
by: Lars Behrmann | last post by:
Hi, i have an ActiveX control placed on my windowsform. Visual Studio has wrapped this and everything should be fine, but it isn't :( The control shows different behaviours between the Visual...
1
by: abhijit | last post by:
Hi Xperts, I have multiple Web Sites in different Live Servers. I want to login any of the sites, and then I will access all the other sites without giving any more login information (i.e I want...
1
by: Pronojit Roy | last post by:
Hi Xperts, I have multiple Web Sites in different Live Servers. I want to login any of the sites, and then I will access all the other sites without giving any more login information (i.e I want...
3
by: asanford | last post by:
I want to create an ASP.NET web application that receives a form POST message, inspects the data, and reroutes the request to one of many different servers. I wrote an IHttpModule which...
15
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two...
2
by: Bart | last post by:
Hi, I ran the same code with two different providers (oledb abd sqlclient), and i got two different behaviours. The code with OLEDB runs perfect without error. The same code with SQLClient...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.