I am retrieving data from an MS SQL database using SQL2000 on Windows XP. I am using VB6.
I am having a very odd problem with certain fields returning empty - when they are not.
Here is my code:
My Select statement is
I then use the following code to assign the values into variables
This code calls some functions (ConvertToDate, ConvertToHMS and Byte2Char) that are not really material to my problem...
But here is my problem - depending on the order in which I read the columns - certain columns will return empty - when there is data there! If I rearrange the order in which I execute these statements then different columns will return blank.
For example: in the code above I fill the values of sSlug and sBody, calling for sSlug first.
With it that way then column id14 will return empty. If I simply reverse the order
Then column id8 will return empty
Can anyone tell me what I am doing wrong?
I am having a very odd problem with certain fields returning empty - when they are not.
Here is my code:
My Select statement is
Code:
Select id1, id2, id8, id14, id35, id38, id186, id5000, id5004 From header_record where record_id=346621
Code:
Do While (rsObjectSet.BOF = False) And (rsObjectSet.EOF = False)
dArcDate = ConvertToDate(Byte2Char(rsObjectSet.Fields("id1") & ""))
dModDate = ConvertToDate(Byte2Char(rsObjectSet.Fields("id2") & ""))
sAuthor = rsObjectSet.Fields("id186") & ""
sSlug = rsObjectSet.Fields("id8") & ""
sBody = rsObjectSet.Fields("id14") & ""
sTimeCode = ConvertToHMS(Byte2Char(rsObjectSet.Fields("id35") & ""))
sTapeLen = ConvertToHMS(Byte2Char(rsObjectSet.Fields("id38") & ""))
sModby = rsObjectSet.Fields("id5000") & ""
sTape = rsObjectSet.Fields("id5004") & ""
Loop
But here is my problem - depending on the order in which I read the columns - certain columns will return empty - when there is data there! If I rearrange the order in which I execute these statements then different columns will return blank.
For example: in the code above I fill the values of sSlug and sBody, calling for sSlug first.
Code:
sSlug = rsObjectSet.Fields("id8") & ""
sBody = rsObjectSet.Fields("id14") & ""
Code:
sBody = rsObjectSet.Fields("id14") & ""
sSlug = rsObjectSet.Fields("id8") & ""
Can anyone tell me what I am doing wrong?
Comment