View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
dave dave is offline
external usenet poster
 
Posts: 4
Default transferring data from access to excel

I've written some code and used the hex editor. All I get
is a few random numbers and symbols on the first few
lines then loads and loads of zeros. Is this what I
should expect or have I done something wrong? Here is the
procedure I've written.

Option Compare Database
Option Explicit
Const conChunksize As Long = 32768

Sub SaveDatToFile()

Dim FileNum As Integer
Dim dbsNozztst As Database
Dim rstLngBinDat As Recordset
Dim FileData As Variant

'Open "db1.mdb" database and "dbt_Pruefbericht" recordset
Set dbsNozztst = OpenDatabase("C:\db1.mdb")
Set rstLngBinDat = dbsNozztst.OpenRecordset
("dbt_Pruefbericht")

'Open "MeasuredData" file to store data
FileNum = FreeFile()
Open "C:\Documents and Settings\brad\My
Documents\MeasuredData.doc" For Binary As FileNum

'Assign data to FileData variable
FileData = rstLngBinDat!dbf_MessDaten.GetChunk(0,
conChunksize)

'Write FileData variable to MeasuredData file
Put FileNum, , FileData

'Close MeasuredData
Close FileNum

End Sub


-----Original Message-----

"dave" wrote in message
...
I thought that might be the case. It may be that I can
decipher the binary numbers when I see them which is

why
I'm still trying.

Dave


Instead of trying to write the data into Excel cells

save it as a file
and then look at the file with a hex editor or

disassembler

Use the Open Statement to create the file and the
Put statement to write to it

Keith


.