[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Funtion to remplace de command SPLIT?

I HAVE A PROBLEM, I JOB IN ACCES 97, BUT I NEED TO OUTPUT INFORMATION TO FILE TXT, BUT IN ACCES 2000 I CAN USED THE COMMAND SPLIT TO FIND THE CHARACTER "@"; BUT NOW I NEED TO WORK IN ACCES 97

EXAMPLE

Sub abrirtxt()
    dir = "C:\N1.10293894.txt"
    Set base = CurrentDb
    Set rs = base.OpenRecordset("select * from   Registro_telefono")
    DoCmd.OpenTable "registro_telefono"
    Open dir For Input As #1
    DoCmd.RunMacro "ocultar_tabla"
    Do While Not EOF(1)
        Registro = LeeRegistro(1)
    Loop
    rs.Close
    Close #1
    DoCmd.Close
    DoCmd.RunMacro ("cerrar_tabla_registro")
End Sub
________________________________________________________

'********* Funcion para leer y extraer registros del archivo*******

Public Function LeeRegistro(numarchivo As Integer)
    Dim Linea As String
    Dim DatosSeparados() As String
    Line Input #numarchivo, Linea
    DatosSeparados = Split(Linea, "@")
    '******************* Insertar Datos a la base de datos************
        If rs.EOF = True Then
            rs.AddNew
            If DatosSeparados(0) <> "" Then
            rs.Fields("tipo_documento") = DatosSeparados(0).................

.............
END FUNTION
 
0
raspicui
Asked:
raspicui
1 Solution
 
bob_onlineCommented:

I = 0
While Len(Linea) > 0
   redim preserve DatosSeparados(I + 1)
   J = Instr(Linea, "@")
   If J > 0 Then
      DatosSeparados(I) = Left$(Linea, J - 1)
      Linea = Mid$(Linea, J + 1)
   Else
      DatosSeparados(I) = Linea
      Linea = ""
   End If
   I = I + 1
Wend
0
 
CleanupPingCommented:
raspicui:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
DanRollinsCommented:
Moderator, my recommended disposition is:

    Accept bob_online's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now