Access 2002/2003 VBA What kind of file is .CRC (Binary, text) ? Howdo I read it with FreeFile()?

R

rebelscum0000

Dear All
Access 2002 w/SP3
Access 2003 w/SP2
Windows XP Pro w/SP2

Type of file: CRC File
Opens with: Unknown application


I want to read all the data in a .CRC file I know I can read it using
FSO, if I click on
File name -> right click on properties, Changes and choose the notepad
to open it.

But I do not want to do this, I want to open the file as is using
FreeFile() and read all the data

The file was created using a program called CdCheck

http://www.kvipu.com/CDCheck/

Can someone please help?

Thanks in advance
Regards,
Antonio Macias
 
T

Tony Toews [MVP]

rebelscum0000 said:
But I do not want to do this, I want to open the file as is using
FreeFile() and read all the data

From the A97 help I think -

When working with large amounts of data, it is often convenient to
write data to or read data from a file. The Open statement lets you
create and access files directly. Open provides three types of file
access:

· Sequential access (Input, Output, and Append modes) is used
for writing text files, such as error logs and reports.
·
Note The Open statement should not be used to open an application's
own file types. For example, don't use Open to open a Word document, a
Microsoft Excel spreadsheet, or a Microsoft Access database. Doing so
will cause loss of file integrity and file corruption.

The following table shows the statements typically used when writing
data to and reading data from files.

Access Type Writing Data Reading Data
Sequential Print #, Write # Input #

I've snipped the non relevant portions.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

rebelscum0000

Tony Toews, Microsoft Access MVP,

Thank you very much for your help, I found out that the .CRC file is
a .txt file
So I did open it as text from VB. VB doesn't care the least about
trivial things like file extensions!

This code does the trick

Sub ReadFile()

Dim strFile As String
Dim intHandle As Integer
Dim strLine As String

strFile = "thefile.crc"
intHandle = FreeFile()
Open strFile For Input As #intHandle
Do Until EOF(intHandle)
Line Input #intHandle, strLine
Debug.Print strLine
Loop
Close #intHandle

End Sub

Once again thank you very much for read my post and the extra
information you provide me

Regards,
Antonio Macias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top