Solved

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

Posted on 1998-05-08
6
201 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
Comment Utility
mögliche Ursachen wird behoben mit

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

0
 
LVL 2

Author Comment

by:Veroland
Comment Utility
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
Comment Utility
Post your code, Veroland.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Accepted Solution

by:
lmorris earned 620 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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.
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…
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…

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

6 Experts available now in Live!

Get 1:1 Help Now