1. Using contents of stream object in image
2. reading contents of an activexscript using DTS objects in vb
I'm using VB6 and SS2000. I'm searching for a table name and I want to search in the actual script in a DTSActiveScriptTask object. I can see the name of the script and the description but is there a way to actually see the script itself? There must be since it is stored somewhere. What object is it? Thanks, Dan
3. VB filesystem object, file dates etc
4. Writing a file with the FileSystem Object
Think of TextStream as a text file with secuencial access. It has the benefits that can be treated as an object instead as a file number: Write #1,"Text" MyTextStream.Write "Text" Regards.
5. File and Filesystem objects
6. Unable to read image file correctly that was written using vb6.0
I am facing a strange problem I ahve a datadase which stores tiff
images using Image datatype in Sql server.
These images are written using a Vb6.0 desktop application with the
following code
==================VB Code====================================
Open strFile For Binary Access Read As #(iFile)
ImageSize = LOF(iFile)
lngNumChunks = ImageSize / 4096
lngOff = ImageSize Mod 4096
strData = String(4096, "0")
For i = 1 To lngNumChunks
strData = String(4096, "0")
Get #(iFile), , strData
rs.Fields("Img").AppendChunk strData
Next
If lngOff > 0 Then
strData = String(lngOff, "0")
Get #(iFile), , strData
rs.Fields("Img").AppendChunk strData
End If
Close #(iFile)
====================VB Code==================================
It works fine when i read it with a VB6.0 application but i have tried
my level best without sucess to read this image file in Dot net.
A sample code that i last tried is as follows
=========Dot Net C# code===========================
SqlCommand cmd=new SqlCommand();
SqlDataReader rdr;
cmd.CommandType=CommandType.Text ;
cmd.CommandText="select img from tblDAllImages where Active = 1 and ID
=1135";
cmd.Connection=con;
con.Open ();
rdr=cmd.ExecuteReader();
System.IO.FileStream fs ;//= new System.IO.FileStream("c:\\aa.tif",
System.IO.FileMode.Create, System.IO.FileAccess.Write);
BinaryWriter bw ;
int BufferSize=100;
byte[] b =new byte[BufferSize];
long retval,startindex=0;
for(int i=0;i<b.Length ;i++)
Response.Write(b[i]);
Response.Write(b.Length);
if (rdr.Read())
{
fs = new FileStream("c:\\aaa11.tif" , FileMode.OpenOrCreate,
FileAccess.Write) ;
bw = new BinaryWriter(fs) ;
startindex = 0 ;
retval = rdr.GetBytes(0 , startindex, b, 0, BufferSize) ;
while( retval == BufferSize )
{
bw.Write(b) ;
bw.Flush();
startindex = startindex + BufferSize;
retval = rdr.GetBytes(0, startindex, b, 0, BufferSize) ;
}
bw.Write(b) ;
bw.Flush();
bw.Close() ;
fs.Close();
}
=========Dot Net C# code===========================
This file gets created but is corrupted.It is almost double the size of
the VB6.0 file.
I guess it is something retated to conversion between byte and string
type but i have even tried to convert the byte to a string and then
save it.
Any help is welcome
Thanks
7. Writing to a file and then reading the file contents
8. File Name used in Image Object
I'm working with the VB source code of someone who does't work with us anymore. The programmer used some images in the code but I can't figure out the names of the files he used. When I go on the properties for the object, I can tell there is a bitmap in the Picture Property, but how can I get the name of the bitmap? -- Mario