2012年2月26日星期日

Full RecordSet not Received from SQL Server ?

My IT dept and I are completely stumped on this problem, and if there is a better forum to post this question to, please let me know. Thanks!

I have an ASP web-site connecting to an Access db, and everything works fine. I ported the Access db to SQL Server 2005 Express and on only 1 page, when I request a recordset, I do not get all the fields returned. Some of the fields are "blank" (not NULL). When I test for NULL (Not IsNull), the answer is True, but the field does not contain the numeric value that I can see in the SQL db.

The page is identicle from the Access based site to the SQL Server based site, so I'm really confused. I checked the values of these 4 fields immediately after retrieving the recordset, but they are "blank" when the db has the value 135 in it. I also verified on one of the variables that the correct value (135) was sent by SQL Server.

I've tested on both SQL Server 2000 and 2005 Express with the exact same results. The Access based site is still working fine. Also, I have 1 other page with the exact same code (4 drop-down boxes selecting names), and it works fine.

So, how does ASP "loose or not receive" the values, or how does SQL "not send" the values?

Details:

My DB had several Null values in other fields, not the 4 fields in question. I took them out, and it still fails.

Client Side:
connection string: STRING = "Driver={SQL Server};Server=LT-464\SQLEXPRESS;Database=IPTracker;UID=cfvkk;PWD=c1234"

Server:
2005 server is on local machine, 2000 server is networked: same failure.

Code for retrieving RS <generated by Dreamweaver 8>:

<%
Dim rsProject
Dim rsProject_cmd
Dim rsProject_numRows

Set rsProject_cmd = Server.CreateObject ("ADODB.Command")
rsProject_cmd.ActiveConnection = MM_cnIPTracker_STRING
rsProject_cmd.CommandText = "SELECT * FROM dbo.Project WHERE ProjectID = ?"
rsProject_cmd.Prepared = true
rsProject_cmd.Parameters.Append rsProject_cmd.CreateParameter("param1", 5, 1, -1, rsProject__MMColParam) ' adDouble

Set rsProject = rsProject_cmd.Execute
rsProject_numRows = 0
%>
DL=<%=CStr(rsProject.Fields.Item("DesignerLeadPtr").Value)%>
Dir=<%=CStr(rsProject.Fields.Item("DirectorPtr").Value)%>
PM=<%=CStr(rsProject.Fields.Item("ProgMgrPtr").Value)%>
DS=<%=CStr(rsProject.Fields.Item("DesignerPtr").Value)%>

At this point the values are "blank."

Any thoughts? Thanks!

Chris

Found the problem. I had inadvertently used a memo field in Access that was ported over to SQL Server, and we all know that is a big no-no.... So, all is well again in the land of the left-coast!

没有评论:

发表评论