Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / December 2003

Tip: Looking for answers? Try searching our database.

Import data from DAT file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shirley - 04 Dec 2003 18:21 GMT
How can I import data from DAT file? Currently I open the
DAT file with Notepad and then save it as TXT file. But
now, the DAT file is too big -about 500MB. After I opened
the DAT, I can't save it in TXT format any more because
not enough memory there to carry this action.

I have to process the huge DAT file every month...

Any help is greatly appreciated!

Shirley
Ronald W. Roberts - 04 Dec 2003 21:15 GMT
> How can I import data from DAT file? Currently I open the
> DAT file with Notepad and then save it as TXT file. But
[quoted text clipped - 7 lines]
>
> Shirley

You can do something like this. If you know the format of the file,
you write the routine to process cline looking for the character(s)
that delimit each field.

This routine came from a program I wrote that reads a Netscape
formatted e-mail file.

Dim cCR As String

cCR = chr(13)
Open "C:\YourFileName.DAT" For Input As #1

'Loop until end of file
'----------------------
Do While Not EOF(1)
   If EOF(1) Then
      'Do some processing at end of file
      '----------------------------------
      Exit Sub
   End If

   'Read in chars until you reach a line feed
   '-----------------------------------------
   MyChar = Input(1, #1)
   cLine = cLine & MyChar

   'If new char is CR process cLine
   '-------------------------------
   If MyChar = cCR Then

      'After processing cLine make cLine null
      '--------------------------------------
      cLine=""
Loop

HTH
Ron
--
Ronald W. Roberts
Roberts Communication
rwr_at_robcom_dot_com@robcom.com
To reply remove "_at_robcom_dot_com"
John Nurick - 06 Dec 2003 21:43 GMT
Hi Shirley,

If all you're doing with Notepad is to open the .DAT file and save as
.TXT, try just renaming the file instead. Or see
http://support.microsoft.com/default.aspx?scid=kb;en-us;304206 which
shows how to change the file extensions that Access will accept.

If you have to do other things to the .DAT file before saving as .TXT,
let us know what they are and someone will probably be able to suggest a
way of automating them.

>How can I import data from DAT file? Currently I open the
>DAT file with Notepad and then save it as TXT file. But
[quoted text clipped - 7 lines]
>
>Shirley

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.