Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Problem - Working in SQL but not in ASP ?!?

Status
Not open for further replies.

ETN

Programmer
Jan 27, 2004
33
CA
Hi all,

I have this very strange problem.. To make a short story i have a new dev server (holding the database and ASP pages), so i've imported my asp code and then my database. Now for the database, i've imported the data from the live server (production) and then corrected 2 tables to respect the new structure of the dev server (some addition have been made but where not exported to the live server yet).

==-> So my problem is that on a asp page for somes reasons (the others ASP pages seems to works so far..), when i make this simple query:
SQLTransac="SELECT * from transac
where id_transac = " & no_transac

when i do a response.Write("fieldname") for each fields, it only shows me the data for the field #1, #2 and #18 (out of 22 fields). For the others it give me an empty string ("").

What is strange is that when I open the SQL Analyser (Microsoft SQL Server), and write the same SELECT, I can see all the data fields.

More strange is that this SELECT I am calling is after an UPDATE and the update work fine... and I do somes INSERT in somes others pages and it work fine too...

And yes this page works on my old dev server....

If anyone has any idea it would be a great help!! I'm hitting my head on my wall, it's starting to hurt!! :-\
 
can you post the code where you get the data and display it please? You're right, this is a very strange error.

Have you tried using an explicit list rather than "SELECT *". How are you loading the recordSet?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

 
OK. i found the problem... My fields where "ntext" (16), i transformed them into varchar(50) and now it works... I don't really understand why it was not working while it was working on the other dev server.. but I believe there is something in the server configuration that say how to handle the ntext format, but I dont have this knowledge since I am not a DBA..

ETN
 
I'm sure I read somewhere about having to explicitly declare text/ntext field types in your sql statement as well as declare them first.

sql = "Select billy, bobby, * from table"

perhaps the sql forum is best for this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top