Hello,
I have an old fashion Database with several random access files and I need to import the data to a new Sql Server dababase the data.
There are tables with 6 Bytes floating numbers fields and we have no Number data type with that length in VB.
I tried and tried and... and can't find.
I found this code in the ERP folder, is AlphaBasic. It use an envoirement namend A-shell from Microsabio . -
MAP1 OOCUM'4750 ! Cabecalhos de Documentos
-
MAP2 SIT'4750,B,1 ! Ocupado (Sim/Nao)
-
MAP2 KEY2'4750 ! Chave Secundaria
-
MAP3 FCA'4750,S,4 ! Cliente/Fornecedor/Armazem
-
MAP3 KEY'4750 ! Chave Primaria
-
MAP4 SERIE'4750,S,1 ! Serie
-
MAP4 TIPDOC'4750,S,1 ! Tipo
-
MAP4 NDOC'4750,S,5 ! Numero
-
MAP2 ARMZ'4750,S,3 ! Armazem
-
MAP2 NRINT'4750,B,3 ! Numero Interno
-
MAP2 SER'ORIG'4750,S,1 ! Documento Origem
-
MAP2 NUM'ORIG'4750,B,2 ! Documento Origem
-
MAP2 DATORIG'4750,S,8 ! Data Documento Origem
-
MAP2 DATREC'4750,S,8 ! Data Computador/Prazo
-
MAP2 DATDOC'4750,S,8 ! Data Documento
-
-
* * * Fields I Can't convert:
-
-
MAP2 VALDES'4750,F,6 ! Valor Desconto
-
MAP2 VALPOR'4750,F,6 ! Valor Portes
-
MAP2 VALSEG'4750,F,6 ! Valor Seguro
-
MAP2 VALIMP'4750,F,6 ! Valor IVA
-
MAP2 VALDOC'4750,F,6 ! Valor Iliquido
-
-
* * *
-
-
MAP2 TRANSP'4750,S,1 ! Codigo Transporte
-
MAP2 FLAGEMI'4750,S,1 ! Emitido (Sim/Nao)
-
MAP2 COD'PAG'4750,B,1 ! Codigo Condicoes Pagamento
-
MAP2 VENDOR'4750,S,3 ! Vendedor
-
MAP2 FNDOC'4750,S,6 ! Documento Referencia
-
MAP2 DATFACT'4750,S,8 ! Data Documento Referencia
-
MAP2 NMOV'4750,B,1 ! Linhas Documento
-
-
* * *
-
-
MAP2 PAGO'4750,F,6 !
-
-
* * *
-
MAP2 RESP'4750,B,1 ! Linhas Satisfeitas
-
MAP2 MOVANUL'4750,B,1 ! Linhas Anuladas
-
MAP2 ANULADO'4750,S,1 ! Anulado (Sim/Nao)
-
MAP2 FILLER'4750,S,23
-
The Fields I Can't convert are Floating with 6 Bytes
Thank you,
Miguel
1 1881
Hello, Miguel,
I have not done this in VB, but you may be able to use the BitConverter class to accomplish what you need. You will need to know how the 6-byte floating values are structured. This includes which byte is the most significant and which the least, and also which bits within the 48 bit array comprise the mantissa and which bits make up the exponent.
You will need to move the 6 bytes (in the correct order) into a 64 bit Integer and then shift the exponent bits into the proper location for a Double precision floating value. You will need to extend the sign bit of the mantissa into the bits that have been "vacated" by shifting the exponent. You will also need to extend the sign bit of the exponent. Then use the Int64BitsToDouble method of the BitConverter class to get a double precision floating value that VB can use.
You might find the following reference helpful as you work on this project: http://www.cse.msu.edu/~cse320/Docum...atingPoint.pdf
Cheers,
Randy
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Randy Webb |
last post by:
Running Apache2 and PHP 4.3.3 on Windows, is there any way that I can
have PHP read an image file and out put its color content?
Preferably, I would like for it to read a .bmp file and output a...
|
by: maxwell |
last post by:
I used to program in matlab
An read an image file with :
fread(a,,0)
which gave me a matrix of 256*256 full of numbers which were the pidxel
values from 0 to 256.
How do i do the same in c++
...
|
by: Pete |
last post by:
I having a problem reading all characters from a file. What I'm trying to
do is open a file with "for now" a 32bit hex value 0x8FB4902F which I want
to && with a mask 0xFF000000 then >> right...
|
by: ESPN Lover |
last post by:
Below is two snippets of code from MSDN showing how to read a file. Is one
way preferred over the other and why? Thanks.
using System;
using System.IO;
class Test
{
public static void...
|
by: Ahmed A. |
last post by:
This will be very helpfull for many!
Using RichTextBox Read/Write Unicode File
http://www.microsoft.com/indonesia/msdn/wnf_RichTextBox.as
p
Private Function ReadFile(ByVal myfile As String)...
|
by: tim |
last post by:
I have a multi-dimensional byte array,
private someArray(,,) as byte
and it's huge
redim someArray(100,640,480,3)
after populating the array, I write it to a text file to
save it. (so I don't...
|
by: paraidy |
last post by:
Hi all, as from object i need to read all byte from a file example c:
\myphoto.jpg and recreate the file with another name to another
directory c:\photo\recreatedphoto.jpg can someone write a...
|
by: Thomas Kowalski |
last post by:
Hi,
currently I am reading a huge (about 10-100 MB) text-file line by line
using
fstreams and getline. I wonder whether there is a faster way to read a
file line by line (with std::string line)....
|
by: vineeth |
last post by:
Hello all,
I have come across a weird problem, I need to determine the amount
of bytes read from a file, but couldn't figure it out ,
My program does this :
__
file = open("somefile")
data =...
|
by: platopathrose |
last post by:
hai friends,
i need some help with codes, to read a BMP file pixel wise.
and to do run Length Encoding.
also there is also another doubt
if we r using fputc, or fgetc
will the count we are...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |