Solved

"RDORESULTSETS""

Posted on 1999-01-13
7
163 Views
Last Modified: 2010-05-03
When I asigne a Rdo Resultset variable data,this data is lost when I excecute a other function . Why do I loos the assigned data and how I can't lose it?
 
Sub Consult()
   
    Dim Rs As rdoResultset
    Dim clsEntins as New CLAENTI

     Set Rs = clsEntins.metLeerEntins("sp_SEL_Uc_ENT_INSC")
     If Not(Rs.EOF And Rs.BOF)

        TxtCoenti.text = Trim$(Rs!EIN_COENTI)
        CboRazSoc.text=BUSCAR(RS!EIN_CODIGO)
        TxtEdad.text=TRIM$(RS!EDAD)  'I loose RS!EDAD Why??
     EndIf
end Sub

Thank you very much, Sorry my English I speak spanish
0
Comment
Question by:euge092598
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:cognition
ID: 1456097
Is RS!EDAD a Text datatype ?

If it is try removing the Trim$().

If it is SQL server and a TEXT field, then you may need to use getchunk, appendchunk functions.
0
 

Expert Comment

by:sbgross
ID: 1456098
if the buscar function opens a rdo recordset on the same connection the previous recordset is closed.  This is by design.  If you want to have two recordsets open at the same time setup another connection.
0
 

Author Comment

by:euge092598
ID: 1456099
I don't open a new RdoResultsets in the buscar function and I don't know about the getchunck() function. Please can you response
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Expert Comment

by:sbgross
ID: 1456100
you need to provide more info, what type of DB, what are the field types, what is the select statement?
0
 

Author Comment

by:euge092598
ID: 1456101
I use SQL SERVER DB, and "buscar function" opens a new rdoresultset
You tell me I loose the first one, How can I preserve that data?

0
 
LVL 3

Accepted Solution

by:
cognition earned 160 total points
ID: 1456102
    Dim s1 as string
     Dim s2 as string
     Dim s3 as string

     Set Rs = clsEntins.metLeerEntins("sp_SEL_Uc_ENT_INSC")
     If Not(Rs.EOF And Rs.BOF)

        s1 = Trim$(Rs!EIN_COENTI)
        s2=RS!EIN_CODIGO
        s3=TRIM$(RS!EDAD)  

        TxtCoenti.text = Trim$(s1)
        CboRazSoc.text=BUSCAR(s2)
        TxtEdad.text=TRIM$(s3)  

     EndIf


Alternatively create another connection, and use that in the BUSCAR function.

0
 

Author Comment

by:euge092598
ID: 1456103
Adjusted points to 160
0

Featured Post

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.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

821 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