•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 363,829 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,136 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser:
Views: 365 | Replies: 3
![]() |
•
•
Join Date: May 2008
Posts: 18
Reputation:
Rep Power: 1
Solved Threads: 0
Thank u so much for sending this code,and i appreciate it so much.But i need to be able to move foward by getting thesame code that will save into the database,Others conversion i used were'nt working.Pls help me with the code that will save in to the database(SQL server) with VB6 this is the one that is loading from the DB
Dim CN As New ADODB.Connection
Dim RS As ADODB.Recordset
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer, FileName As String
Private Const ChunkSize As Integer = 16384
Private Const conChunkSize = 100
Private Sub Form_Load()
CN.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Pubs;Data Source=Test"
Dim strsql As String
strsql = "SELECT * FROM pub_info where pub_id = '9999'"
RS.Open strsql, CN, adOpenForwardOnly, adLockReadOnly
ShowPic
Set RS = Nothing
Set RS = New Recordset
End Sub
Private Sub ShowPic()
DataFile = 1
Open "pictemp" For Binary Access Write As DataFile
Fl = RS!logo.ActualSize ' Length of data in file
If Fl = 0 Then Close DataFile: Exit Sub
Chunks = Fl \ ChunkSize
Fragment = Fl Mod ChunkSize
ReDim Chunk(Fragment)
Chunk() = RS!logo.GetChunk(Fragment)
Put DataFile, , Chunk()
For i = 1 To Chunks
ReDim Buffer(ChunkSize)
Chunk() = RS!logo.GetChunk(ChunkSize)
Put DataFile, , Chunk()
Next i
Close DataFile
FileName = "pictemp"
Picture1.Picture = LoadPicture(FileName)
End Sub
I need exact of this that will save into DB
Thanks.Pls treat urgently
Dim CN As New ADODB.Connection
Dim RS As ADODB.Recordset
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer, FileName As String
Private Const ChunkSize As Integer = 16384
Private Const conChunkSize = 100
Private Sub Form_Load()
CN.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=Pubs;Data Source=Test"
Dim strsql As String
strsql = "SELECT * FROM pub_info where pub_id = '9999'"
RS.Open strsql, CN, adOpenForwardOnly, adLockReadOnly
ShowPic
Set RS = Nothing
Set RS = New Recordset
End Sub
Private Sub ShowPic()
DataFile = 1
Open "pictemp" For Binary Access Write As DataFile
Fl = RS!logo.ActualSize ' Length of data in file
If Fl = 0 Then Close DataFile: Exit Sub
Chunks = Fl \ ChunkSize
Fragment = Fl Mod ChunkSize
ReDim Chunk(Fragment)
Chunk() = RS!logo.GetChunk(Fragment)
Put DataFile, , Chunk()
For i = 1 To Chunks
ReDim Buffer(ChunkSize)
Chunk() = RS!logo.GetChunk(ChunkSize)
Put DataFile, , Chunk()
Next i
Close DataFile
FileName = "pictemp"
Picture1.Picture = LoadPicture(FileName)
End Sub
I need exact of this that will save into DB
Thanks.Pls treat urgently
•
•
Join Date: Feb 2007
Location: Bangalore,India
Posts: 1,140
Reputation:
Rep Power: 4
Solved Threads: 68
•
•
Join Date: May 2008
Posts: 18
Reputation:
Rep Power: 1
Solved Threads: 0
The one i tried were bringing different binary conversion different from the one u sent to me and from there i could not compare the one in the backend to the picture in the front end.unless i get thesame binary conversion that is when i would be able to compare and from there trap the duplicate of that binary
Thanks
Thanks
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
ad ad server ad serving advertising ajax architecture asp backup beta crash daniweb database developer development doubleclick enterprise google hacker hyper-v image recognition image search internet linux longhorn mail management studio 2005 microsoft mmorpg msdn news office open qmail red hat scsi search security server server 2008 smtp software source sql survey upgrade video search vista vmware windows workspace
- Previous Thread: re loading image from sql server using vb6
- Next Thread: crystal report selection formula help pls



Linear Mode