取消
显示结果 
搜索替代 
您的意思是: 

SQL Fetch Recordset Data provides incomplete results

已解决!
转到解答
I just tried it. The same query works correctly in SQL Server.
0 项奖励
11 条消息(共 19 条)
2,185 次查看
Can you post a VI that has the 2D array with the data in it?  Just copy the array to the front panel of a new VI, set the values as default, and save it.  I have 8.5, so it would have to be that or earlier.  I want to say I've seen this problem before, but it has been many years.
0 项奖励
12 条消息(共 19 条)
2,175 次查看
Are the fields for all columns set up the same in SQL?
0 项奖励
13 条消息(共 19 条)
2,174 次查看

All fields are defined as text in the SQL database. Attached is the VI that I am using for debugging the issue. For some reason I can't get the variant array to "remember" the default valves. I even made a constant from the results but that didn't work either.

 

 

0 项奖励
14 条消息(共 19 条)
2,136 次查看
You need to copy and paste the variant indicator(with data in it) to a new VI, change the indicator to a control, then set the values as default(right click on the edge of the array). Save the new VI and post it.
0 项奖励
15 条消息(共 19 条)
2,128 次查看
That is what I did, but for some reason it didn't work. Attached is another version that converts the variant array to a string array. I was able to get the string array to default to the values I read from SQL.
下载全部
0 项奖励
16 条消息(共 19 条)
2,119 次查看
I can't open your Variant Array.vi because I only have 8.5, but I was able to open the other one.  I never pass the error out cluster of the variant conversion vi because it returns errors that aren't really errors.  I don't remember all of the details, but many years ago I learned that I couldn't wire that without screwing everything up downstream.  Try to leave that unwired and see what happens. 
0 项奖励
17 条消息(共 19 条)
2,101 次查看
解答
已被主题作者 Willy2a 接受

Hi all,

 

Just quickly read through this post and noticed you have set some of your table columns to data type text. I have had this same issue, if you change your columns to nchar(1000) your data will be returned correctly. It appears because text columns are dynamic (I think!), LabVIEW does not allocate enough/any memory to store data returned.

 

As said I have had this before atleast twice on different systems now. I assume the same behaviour will occur using data type blob etc.

 

Thanks,

 

Steve

18 条消息(共 19 条)
2,091 次查看
Aha! That was it. I changed all the fields in SQL to nchar(100) and everything seems to work now - for some reason changing one field to nchar(1000) had no effect, but changing them all to nchar(100) fixed it. Thank you all.
Message Edited by Willy2a on 12-22-2009 08:40 AM
0 项奖励
19 条消息(共 19 条)
2,083 次查看