Solved

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

Posted on 1998-05-08
6
207 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
[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
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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

690 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