Solved

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

Posted on 1999-01-15
8
325 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
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:cognition
Comment Utility
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
Comment Utility
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
Comment Utility
xcuse me what is ADO?
0
 
LVL 3

Expert Comment

by:cognition
Comment Utility
I have always thought it was a bug in rdo, and now in ado, so perhaps it is a bug in SQL Server.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:anderse
Comment Utility
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
Comment Utility
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
Comment Utility
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 100 total points
Comment Utility
I hope that I have answered your question !
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now