|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Function not returning all the data, just some
Hi,
I've put together a "getvalues" function to return specific information from a table or query. I pass it a list of requested fields separated by a pipe | character. The subroutine splits the fields into an array and gets the data from the fetched record, and puts together a data return variable filled with the specific data, again separated by a pipe. The record is fetched fine but the data is not accessed from it correctly. It does work fine in Access but not SQL!? The basic function works like this call returndata("data1|data2|..." function returndata(requestedfields) requestedfieldarray = split(requestedfields,"|") for i = 0 to ubound(requestedfieldarray) builddata = builddata & record(requestedfieldarray(i)) & "|" next returndata = builddata end function some of fields come back fine, some do not. I also find that if I hit each field early in the function For Each objField In record.Fields scratchdata = objfield.value Next Then the function works fine. But I'd rather not use that overhead to make things work. I'm just upgrading from Access to SQL but that shouldn't have anything to do with it (I think). Anybody have any thoughts?? Last edited by strider219 : April 2nd, 2004 at 11:40 AM. |
|
#2
|
|||
|
|||
|
does your fields that doesnot work have two name? ex: "Last name" ?
if it work with For each do it this way..th uesr will wait a 0.5 seconde longer that's it.. |
|
#3
|
|||
|
|||
|
Think I found it
I think the problem was that I was using the ntext data type. I've switched over to nvarchar and that seems to have fixed it tho I'm still testing. Seems wasteful tho to fix an arbitrarily large field length to handle the few times it may be used to the max when a variable length field would work better.
Oh well. If anyone has a better idea I'd welcome your input. Thanks. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Function not returning all the data, just some |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|