Problem field

  • Thread starter Thread starter R. Choate
  • Start date Start date
R

R. Choate

I'm going crazy with this thing. I'm using ADO and opening a 6-field recordset that I am trying to save to an "ADTG" file. 5 of the
fields are text, and one them is numeric, with precision = 5. This happens to be the 4th field in the recordset. When I open the
recordset, I can see that this field has a defined size of minus one. I get an error when I try to save the recordset, because of
this field. If I leave that field out, it saves fine, but I can't leave that field out, I need it. The field has no records with
more that 5 digits, and all are integers. That is, they are customer numbers (ie 6807 or 90521). There are no records with fewer
than 3 digits (ie 581). The original source of the data is AS400. I have no idea what to do at this point. I didn't post my code
because I know it works; I just need to add something to fix the problem with that one field. I open a connection, I open a
recordset, I attempt to save the recordset to a .dat file, and then I close the rst and the cnt and end the sub. I have done this
many times before with other various data sources, but not with AS400 data. I should add that even with the problem on that field, I
do get a recordset of the proper size, and none of the fields are null. Please advise.
 
I'm a beginner at SQL Server, but your description of size of minus one for
the numeric field doesn't seem right. I think it should be at least 5, but
I'm guessing.


R. Choate said:
I'm going crazy with this thing. I'm using ADO and opening a 6-field
recordset that I am trying to save to an "ADTG" file. 5 of the
fields are text, and one them is numeric, with precision = 5. This happens
to be the 4th field in the recordset. When I open the
recordset, I can see that this field has a defined size of minus one. I
get an error when I try to save the recordset, because of
this field. If I leave that field out, it saves fine, but I can't leave
that field out, I need it. The field has no records with
more that 5 digits, and all are integers. That is, they are customer
numbers (ie 6807 or 90521). There are no records with fewer
than 3 digits (ie 581). The original source of the data is AS400. I have
no idea what to do at this point. I didn't post my code
because I know it works; I just need to add something to fix the problem
with that one field. I open a connection, I open a
recordset, I attempt to save the recordset to a .dat file, and then I
close the rst and the cnt and end the sub. I have done this
many times before with other various data sources, but not with AS400
data. I should add that even with the problem on that field, I
 
Apparently, the defined size is not equal to the actual size or the precision value. I do believe very strongly, based on many posts
I have read in many groups, plus what I've read in reference materials, that this is related to my problem. I read in one place that
the defined size is also related to the length of the field which precedes it. In my case, the preceding field, as well as the
succeeding field, are text fields. Hopefully, someone can help me to get past this bump in the road.
--
RMC,CPA


I'm a beginner at SQL Server, but your description of size of minus one for
the numeric field doesn't seem right. I think it should be at least 5, but
I'm guessing.


R. Choate said:
I'm going crazy with this thing. I'm using ADO and opening a 6-field
recordset that I am trying to save to an "ADTG" file. 5 of the
fields are text, and one them is numeric, with precision = 5. This happens
to be the 4th field in the recordset. When I open the
recordset, I can see that this field has a defined size of minus one. I
get an error when I try to save the recordset, because of
this field. If I leave that field out, it saves fine, but I can't leave
that field out, I need it. The field has no records with
more that 5 digits, and all are integers. That is, they are customer
numbers (ie 6807 or 90521). There are no records with fewer
than 3 digits (ie 581). The original source of the data is AS400. I have
no idea what to do at this point. I didn't post my code
because I know it works; I just need to add something to fix the problem
with that one field. I open a connection, I open a
recordset, I attempt to save the recordset to a .dat file, and then I
close the rst and the cnt and end the sub. I have done this
many times before with other various data sources, but not with AS400
data. I should add that even with the problem on that field, I
 
Hi,

Check my reply on your previous posting. It could help

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp


R. Choate said:
I'm going crazy with this thing. I'm using ADO and opening a 6-field
recordset that I am trying to save to an "ADTG" file. 5 of the
fields are text, and one them is numeric, with precision = 5. This happens
to be the 4th field in the recordset. When I open the
recordset, I can see that this field has a defined size of minus one. I
get an error when I try to save the recordset, because of
this field. If I leave that field out, it saves fine, but I can't leave
that field out, I need it. The field has no records with
more that 5 digits, and all are integers. That is, they are customer
numbers (ie 6807 or 90521). There are no records with fewer
than 3 digits (ie 581). The original source of the data is AS400. I have
no idea what to do at this point. I didn't post my code
because I know it works; I just need to add something to fix the problem
with that one field. I open a connection, I open a
recordset, I attempt to save the recordset to a .dat file, and then I
close the rst and the cnt and end the sub. I have done this
many times before with other various data sources, but not with AS400
data. I should add that even with the problem on that field, I
 
R. Choate said:
I'm going crazy with this thing. I'm using ADO and opening a 6-field recordset that
I am trying to save to an "ADTG" file. 5 of the
fields are text, and one them is numeric, with precision = 5. This happens to be
the 4th field in the recordset. When I open the
recordset, I can see that this field has a defined size of minus one. I get an
error when I try to save the recordset, because of
this field. If I leave that field out, it saves fine, but I can't leave that field
out, I need it. The field has no records with
more that 5 digits, and all are integers. That is, they are customer numbers (ie
6807 or 90521). There are no records with fewer
than 3 digits (ie 581). The original source of the data is AS400. I have no idea
what to do at this point. I didn't post my code
because I know it works; I just need to add something to fix the problem with that
one field. I open a connection, I open a
recordset, I attempt to save the recordset to a .dat file, and then I close the rst
and the cnt and end the sub. I have done this
many times before with other various data sources, but not with AS400 data. I
should add that even with the problem on that field, I
do get a recordset of the proper size, and none of the fields are null. Please advise.
I have no idea if this will work,
but have you tried multiplying problem
field by 1 in your recordset query?

strSQL="SELECT ..., [problemfield]*1 As newtry, ...
 
Back
Top