473,408 Members | 2,888 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,408 software developers and data experts.

Problems accessing data from recordset (SQL Server 2000)

I'm having a strange problem and I was hoping someone could give me
some guidance. I am accessing a Microsoft SQL 2000 server through ASP
scripts on our webserver. The sql server and web server are on the
same network.

This code used to work, and started acting strangely after I moved it
to a new webserver and SQL server (from testing
environment->production). Previously the web server and sql database
were running on the same machine, the software versions are all the
same.

When I do a SELECT statement to retrieve data, I then pull data from
each of the fields I need. The problem is certain fields cause a
strange behavior. When I pull the data from one field, all subsiquent
uses of the RecordSet object return empty when retrieveing data from
other fields. (even though I know all fields contain information)

For example:

set rs = db.execute("SELECT * FROM myTable WHERE ID=1")
response.write rs("FieldA") & "//" & rs("FieldB") & "//" & rs("FieldC")
& "//" & rs("FieldD")

Outputs "AAA//////" whereas:

set rs = db.execute("SELECT * FROM myTable WHERE ID=1")
response.write rs("FieldD") & "//" & rs("FieldC") & "//" & rs("FieldB")
& "//" & rs("FieldA")

Outputs "DDD/////"

Any ideas? Thanks for your help - it is much appreciated!

Lee

Nov 30 '05 #1
2 1439
CrazyAtlantaGuy wrote:
When I do a SELECT statement to retrieve data, I then pull data from
each of the fields I need. The problem is certain fields cause a
strange behavior. When I pull the data from one field, all subsiquent
uses of the RecordSet object return empty when retrieveing data from
other fields. (even though I know all fields contain information)

For example:

set rs = db.execute("SELECT * FROM myTable WHERE ID=1")
http://www.aspfaq.com/show.asp?id=2096
response.write rs("FieldA") & "//" & rs("FieldB") & "//" &
rs("FieldC") & "//" & rs("FieldD")

Outputs "AAA//////" whereas:

set rs = db.execute("SELECT * FROM myTable WHERE ID=1")
response.write rs("FieldD") & "//" & rs("FieldC") & "//" &
rs("FieldB") & "//" & rs("FieldA")

Outputs "DDD/////"


OK, I guess you are using ODBC, and FieldD is a Text column, right? You are
likely running into an old ODBC bug which is described here:
http://www.aspfaq.com/show.asp?id=2188

Switch to using the native SQL OLE DB provider (SQLOLEDB) and this problem
should go away.
http://www.aspfaq.com/show.asp?id=2126

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 30 '05 #2
Thanks Bob!

I'm glad I asked, that was the problem exactly. I've swapped out the
connection strings and using the SQLOLEDB now. Works like a champ.

The quick response is much appreciated,

Lee

Nov 30 '05 #3

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

Similar topics

1
by: Brad Pears | last post by:
Our graphic designer is developing our new company website. We have switched providers and currently she is working on the new website which currently ressides on the new providers server as they...
3
by: Ryan | last post by:
I have a problem with record locking / blocking within an application. The app is quite straight forward. Written in Delphi 5 using BDE to access a SQL 7 database (Win2K server). Every so often...
2
by: M Wells | last post by:
Hi All, I'm trying to track down a mysterious problem we're experiencing in which updates and inserts to tables in our mssql2k server appear to be 'disappearing.' To explain our situation: ...
1
by: B Moor | last post by:
Hello, I am quite bogged down with this problem and would like some tips/help if any one has any. Thanks in advance. The Problem ----------- This system initially seemed quite stable for...
2
by: David C. Barber | last post by:
upsized an MDB to ADP/SQL Server 2000 under Access 2000. All the DAO code that I've changed to ADO code is working fine, HOWEVER the form Record Source itself does not seem willing to return data....
1
by: Steve Mauldin | last post by:
I have Two ASP.Net applications running on a windows 2000 Server box. One is www.abc.com and one is www.dfg.com . They have the same code in them to connect to the same SQL Server 2000 database...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
20
by: TC | last post by:
I need an automated procedure to copy data from an Access table to a SQL Server table. Speed is important. What is the recommended technique? I can export the data from Access, copy it via FTP,...
2
by: teddysnips | last post by:
One of our clients has reported a problem. Everything was working fine on Monday, but since Tuesday all is going wrong. The sysadmin assures me that there have been no changes to the network, or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.