MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old April 2nd, 2004, 11:34 AM
strider219 strider219 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 strider219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old April 5th, 2004, 11:26 AM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
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..

Reply With Quote
  #3  
Old April 5th, 2004, 04:14 PM
strider219 strider219 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 strider219 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Function not returning all the data, just some


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway