Solved

RDO thingy, problem, hasell .......

Posted on 1998-05-08
6
204 Views
Last Modified: 2009-07-29
I've asked this question before, but with no avail. I would really like to know why I seem to be the only person getting this problem. My system is in production now with 250 users connected so I dont like having uncertainties in the program. So I would appreciate it if anybody can tell me whats going on.


Okay – I use a SQL server 6.5 db. I access the database through RDO.

Everything works fine (Almost)

I get a couple of records that when I access them (Look at their values) it works fine. When I try do it the second time I find the record has turned to NULL. Ie.

If I do this:

Debug.print RS!Record

Debug.print RS!Record
I will get this "Hello World" the first time and a null value the second.

Even if the statements are exactly after each other. I also use the default cursor.

Has anybody an Idea why I get this.

It was fairly easy work around the problem but I still would like to know why it happens and why only on two fields (Both is text (16)) .

Thnx in advance.

Acually I found it on some more tables now .....
I amolost think it has something to do with SQL .....
0
Comment
Question by:Veroland
6 Comments
 

Expert Comment

by:berlet
ID: 1444036
mögliche Ursachen wird behoben mit

IF ISNUL (Data.Recordset.Field("Feldname")) = False then ....

0
 
LVL 2

Author Comment

by:Veroland
ID: 1444037
Its only null the second time I access the record.
If i say isnull(rs!Record) 2 times I will get False then True
0
 
LVL 5

Expert Comment

by:bin_huwairib
ID: 1444038
Post your code, Veroland.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Accepted Solution

by:
lmorris earned 620 total points
ID: 1444039
This happens when you go against a text field without using the getchunk method. If you modify your program to retrieve the text field using getchunk, your problem will be cured! Here is a working example that uses SQL's pub database to demonstrate your problem, then shows you how to retrieve the field using the getchunk method.

    Dim en As rdoEnvironment
    Set en = rdoEnvironments("Default_Environment")
   
    Dim cn As rdoConnection
    Set cn = en.OpenConnection("", rdDriverNoPrompt, False, "DSN=LocalServer")
   
    Dim rs As rdoResultset
    Set rs = cn.OpenResultset("Select * From Pubs..Pub_Info", rdOpenKeyset)
   
    MsgBox "ISNull? " & IsNull(rs!pr_info)
    MsgBox "ISNull? " & IsNull(rs!pr_info)
   
    Dim strPRInfo As String
    strPRInfo = rs!pr_info.GetChunk(rs!pr_info.ColumnSize)
   
    MsgBox strPRInfo
   
    strPRInfo = rs!pr_info.GetChunk(rs!pr_info.ColumnSize)
   
    MsgBox strPRInfo
   
    rs.Close
    cn.Close
    en.Close

0
 
LVL 2

Author Comment

by:Veroland
ID: 1444040
What I really would like to know is why this happes.

But Hey, thanks - This question was posted on a lot of places for quite some time.
0
 
LVL 2

Expert Comment

by:lmorris
ID: 1444041
I don't know for sure, but my best guess would be pointer related. If you look at the GetChunk method, it has an offset property. I think when you do a rs!pr_info, it retrieves from 0 to ?. The next time it retrieves from ? to ?. You'll also notice, that if you move off the record, then back to it, you'll be able to retrieve the field again.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

791 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