![]() |
transferring data from access to excel
I'm using office 97 and am tryin to get some data from
access to excel. With the code I've written in excel all that is displayed in the label is the default caption. How can I display what is in varVariable? Thanks for any help. This is my code: Option Explicit Sub Data() lblDat.Caption = varVariable() End Sub Function varVariable() As Variant Dim dbsNozztst As Database Dim rstLngBinDat As Recordset Const conChunksize As Long = 32768 'open database "db1.mdb" and recordset "dbt_Pruefbericht" Set dbsNozztst = OpenDatabase("C:\db1.mdb") Set rstLngBinDat = dbsNozztst.OpenRecordset ("dbt_Pruefbericht") 'use GetChunk method to assign long binary data to a variable varVariable = rstLngBinDat!dbf_MessDaten.GetChunk(0, conChunksize) 'close database and recordsets dbsNozztst.Close End Function |
transferring data from access to excel
"dave" wrote in message
... varVariable = rstLngBinDat!dbf_MessDaten.GetChunk(0, conChunksize) Should be: Set varVariable = rstLngBinDat!dbf_MessDaten.GetChunk(0, conChunksize) P |
transferring data from access to excel
Thanks for all your help. What I'm trying to do is move
some data stored as an OLE object from access to excel in the hope that I'll be able to view it as numerical values which is what I think it is. The data comes directly from a machine which measures the height of water in 48 separate glasses. At the moment all I see is "long binary data" in the field dbf_messdaten. Dave -----Original Message----- http://support.microsoft.com/default.aspx?scid=kb;EN- US;194975 HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk -- Regards, Tom Ogilvy Tom Ogilvy wrote in message ... GetChunk is for working with BLOBs. I suspect he is trying to put a picture in the label. -- Regards, Tom Ogilvy merjet wrote in message news:BUK4b.246927$Oz4.65734@rwcrnsc54... It's not clear what you are trying to do he varVariable = rstLngBinDat!dbf_MessDaten.GetChunk (0, conChunksize) Is dbf_MessDaten the name of a field? If so, then dropping ".GetChunk . .." should assign to varVariable the value of that field for the first record in the table. I can't fathom what ".GetChunk . ." could be or your intent using it. HTH, Merjet . |
transferring data from access to excel
"dave" wrote in message ... Thanks for all your help. What I'm trying to do is move some data stored as an OLE object from access to excel in the hope that I'll be able to view it as numerical values which is what I think it is. The data comes directly from a machine which measures the height of water in 48 separate glasses. At the moment all I see is "long binary data" in the field dbf_messdaten. Dave Long binary data is unlikely to be simple numeric values. Typically this type is used to store binary files such as images. You really need to know the data format before you can make a sensible use of it. Keith |
transferring data from access to excel
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 -----Original Message----- "dave" wrote in message ... Thanks for all your help. What I'm trying to do is move some data stored as an OLE object from access to excel in the hope that I'll be able to view it as numerical values which is what I think it is. The data comes directly from a machine which measures the height of water in 48 separate glasses. At the moment all I see is "long binary data" in the field dbf_messdaten. Dave Long binary data is unlikely to be simple numeric values. Typically this type is used to store binary files such as images. You really need to know the data format before you can make a sensible use of it. Keith . |
transferring data from access to excel
There is no documenation on what the machine is doing and what it might be
putting in the field? (and how you might read that information) -- Regards, Tom Ogilvy "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 -----Original Message----- "dave" wrote in message ... Thanks for all your help. What I'm trying to do is move some data stored as an OLE object from access to excel in the hope that I'll be able to view it as numerical values which is what I think it is. The data comes directly from a machine which measures the height of water in 48 separate glasses. At the moment all I see is "long binary data" in the field dbf_messdaten. Dave Long binary data is unlikely to be simple numeric values. Typically this type is used to store binary files such as images. You really need to know the data format before you can make a sensible use of it. Keith . |
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 . |
transferring data from access to excel
I wish. I've spent the last 6 weeks trying to get such
information. Problem is was built by an Austrian company 6 yrs ago and unfortunately the Austrian guys are not very forthcoming with information. -----Original Message----- There is no documenation on what the machine is doing and what it might be putting in the field? (and how you might read that information) -- Regards, Tom Ogilvy "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 -----Original Message----- "dave" wrote in message ... Thanks for all your help. What I'm trying to do is move some data stored as an OLE object from access to excel in the hope that I'll be able to view it as numerical values which is what I think it is. The data comes directly from a machine which measures the height of water in 48 separate glasses. At the moment all I see is "long binary data" in the field dbf_messdaten. Dave Long binary data is unlikely to be simple numeric values. Typically this type is used to store binary files such as images. You really need to know the data format before you can make a sensible use of it. Keith . . |
transferring data from access to excel
"dave" wrote in message ... 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. It sounds like the zeroes are padding to make up the required dataset length, the odds are the developers used their own algorithms to store the data. You need either solid data about the format or some reference output to compare the dataset with. Keith |
All times are GMT +1. The time now is 08:48 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com