[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 1998-05-08
6
Medium Priority
?
213 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
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.

 
LVL 2

Accepted Solution

by:
lmorris earned 1860 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month18 days, 5 hours left to enroll

829 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