|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ADO STREAM problem
It seems that the method LoadFromFile works in Developer mode, but when I make an .exe I get "File Could Not Be opened." Anyone know what gives on this? Thanks.
|
|
#2
|
|||
|
|||
|
Can u post a part of your code which have this wrong??
|
|
#3
|
|||
|
|||
|
Code:
Private Sub Form_Load()
SendInfo
End Sub
Public Function SendInfo()
If Command <> "" Then 'must have a command line argument
ReadIPFile
Socket.Close
Socket.Connect strIP, 500 'sends us into Socket_Connect event
Else
MsgBox "USAGE: DROP ANY FILE ON ME."
End If
End Function
Private Sub Socket_Connect()
Dim adoStream As New ADODB.Stream
Dim ifFile As FILE_INFO
adoStream.Open
adoStream.Type = adTypeBinary
'open file and read it in
'Open Command For Binary As #1
'Get #1, , data
adoStream.LoadFromFile Command '*************FAILS IN EXE***********
'Close #1
'set file info
ifFile.size = adoStream.size
ifFile.filepath = strPath & GetFileName(Command)
'send file info first
Socket.SendData ifFile.size & "-" & ifFile.filepath
DoEvents 'flush the socket
'now send the actual data
Socket.SendData data
'DoEvents 'flush the socket
'clean up
'Socket.Close
'adoStream.Close
'End
End Sub
here is the code. I mark where it fails when it's made an .exe |
|
#4
|
|||
|
|||
|
I think it's right if the "command" path is right and can be accessed!..
Knowledge link: http://msdn.microsoft.com/library/d...les_vb01_18.asp |
|
#5
|
|||
|
|||
|
If it's able to be accessed in developer mode it should be able to be accessed in an executable right?
|
|
#6
|
|||
|
|||
|
Yes,I'm sure..Your Sub "Socket_Connect" is right..
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > ADO STREAM problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|