?
Solved

Using datatype Text (SQLServer) or PM (Access) with ADO

Posted on 1999-01-15
8
Medium Priority
?
341 Views
Last Modified: 2013-12-25
After I have inspected the value of a column with datatype PM (or Text in SQLServer) using an ADO recordset the value vanishes into thin air!

Ex:
    dim varA as variant, varB as variant

    varA=adoRS("PMField")
    'varA now contains data
    varB=adoRS("PMField")
    'varB now contains NULL

Also, if I reference the value of a PM-column that is located AFTER a column of another type, before I reference the other column, the values of the column before my PM-column is reset.

Ex: If the table looks like this:

   PM1    Int1    Int2    PM2

   If I reference PM2 before I reference Int1 or Int2 the
   values in Int1 and Int2 become zero.


Help me, anyone...?
0
Comment
Question by:anderse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:cognition
ID: 1499078
You will need to change your code to :

varA=adoRS("PMField")
varB=varA

If the data that is held in the text field is very large, then you will also need to investigate the use of chunks. See article Q180368 in the MS knowledge base.

You will even get this problem if you use the instant watch, to view the value before it is assigned to the variable. It also happens in RDO.

0
 

Author Comment

by:anderse
ID: 1499079
The first example I made was just that, an example, and was as such only entered to make my problem more clear.

I also need to know why accessing a later column of type PM erases the values in the previous, unaccessed columns.
0
 

Expert Comment

by:tato
ID: 1499080
xcuse me what is ADO?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Expert Comment

by:cognition
ID: 1499081
I have always thought it was a bug in rdo, and now in ado, so perhaps it is a bug in SQL Server.
0
 

Author Comment

by:anderse
ID: 1499082
What did you think was a bug? PM datatypes erasing the values of previous columns or the fact that you can only 'touch' a PM field once?
0
 
LVL 3

Expert Comment

by:cognition
ID: 1499083
I assume the problems are related. I have only seen the problem where you can only touch a PM/TEXT field once, and have always programmed round it.

I don't know what PM is (other than equivalent to TEXT), so I imagine the problem is with rdo/ado.

If you use the getchunk methods, then the problem MIGHT not occur.

TATO
ADO is activeX data objects, RDO is remote data objects. DAO is Data access objects. They are VB objects that allow you to manipulate databases.

0
 

Author Comment

by:anderse
ID: 1499084
I guess the best thing to do is to, as you say, program around it. But I still feel uneasy about it... Mysteriously loosing data isn't the funniest of situations..

Thanks for the help.
0
 
LVL 3

Accepted Solution

by:
cognition earned 200 total points
ID: 1499085
I hope that I have answered your question !
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question