Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

ADODB record set from SQL Server 2008 garbles some fields when read in Excel VBA in Windows XP, but not Windows 7 Expand / Collapse
Author
Message
Posted Tuesday, October 30, 2012 8:23 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 31, 2012 8:54 PM
Points: 2, Visits: 1
1. Source of recordset SQL Server stored procedure.
2. Means of access: ADODB recordset in Excel VBA, using adOpenForwardOnly
3. Referenced library in VBA: Microsoft ActiveX Data Objects 2.8 Library
4. All fields turn up in the expected text format when I run the stored procedure right on the SQL server management studio.
4. In Windows 7, all fields are delivered as they should.
5. In Windows XP, two of the text fields (not too long, under 200 characters) become garbled.

By "garbled" I mean turn up with octet values in the range 0 to 31 (i.e., less than a space) with a few,
scattered in the field, of higher values.

Any ideas? I'm stumped!
Post #1379135
Posted Wednesday, October 31, 2012 9:00 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 31, 2012 8:54 PM
Points: 2, Visits: 1
I'll go ahead and talk with myself here, relieved that I found an answer. When the SQL Server delivers a field typed varchar(max), that field turns into trash upon ADODB delivery to SQL Server 2008 (maybe other versions as well but this one for sure). To avoid the problem, don''t use varchar(max) as a type for any field.
Post #1379589
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse