?
Solved

Funtion to remplace de command SPLIT?

Posted on 2003-02-28
4
Medium Priority
?
254 Views
Last Modified: 2010-04-07
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
Comment
Question by:raspicui
[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
4 Comments
 
LVL 5

Accepted Solution

by:
bob_online earned 200 total points
ID: 8041436

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
 

Expert Comment

by:CleanupPing
ID: 8900983
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 9001649
Moderator, my recommended disposition is:

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

DanRollins -- EE database cleanup volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…
Suggested Courses
Course of the Month9 days, 18 hours left to enroll

762 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