|
-
August 31st, 2001, 03:33 AM
#1
Binary to Text
I have a Binary file which has to be changed to text and inserted into database
-
August 31st, 2001, 03:37 AM
#2
Re: Binary to Text
declare a type with teh struct of record of your file...
type rec_t
name as string
age as long
end type
private sub LOadTableFromFile()
dim rec as rec_t
open "xxx" for bynary as #1
do while note eof(1)
get #1,,rec
'put code of insert into DB
loop
close #1
end sub
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
August 31st, 2001, 03:39 AM
#3
Re: Binary to Text
declare a type with the struct of record of your file...
type rec_t
name as string
age as long
end type
private sub LOadTableFromFile()
dim rec as rec_t
open "xxx" for bynary as #1
do while note eof(1)
get #1,,rec
'put code of insert into DB
loop
close #1
end sub
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
August 31st, 2001, 08:36 AM
#4
Re: Binary to Text
I am not able to translate a binary file to Text File
-
August 31st, 2001, 08:41 AM
#5
Re: Binary to Text
type rec_t
name as string
age as long
end type
private sub LOadTableFromFile()
dim rec as rec_t
open "xxx" for bynary as #1
do while note eof(1)
get #1,,rec
'put code of insert into DB
'tHIs is a sample of insert:
'"INSERT into tabella (name,age) VALUES (" & rec.name & "," & cstr(rec.age) & ")"
loop
close #1
end sub
U don't traslate file from bynary to text but U read directly file in bynary...
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
-
August 31st, 2001, 08:43 AM
#6
Re: Binary to Text
type rec_t
name as string
age as long
end type
private sub LOadTableFromFile()
dim rec as rec_t
open "xxx" for bynary as #1
do while note eof(1)
get #1,,rec
'put code of insert into DB
'tHIs is a sample of insert:
'"INSERT into tabella (name,age) VALUES (" & rec.name & "," & cstr(rec.age) & ")"
loop
close #1
end sub
U don't traslate file from bynary to text but U read directly file in bynary... I assume that file has a struct well defined... so U can difine its struct with VB type...
<center>
<HR width=80%>
<img src='http://web.tiscali.it/bertaplanet/im...ertaplanet.gif'>
</center>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|