Close All Open Files
Is there a simple way to close all files that have been opened with the Open and FreeFile function? If you dont know what file numbers are open, to avoid any closing errors, if you loop through some file numbers you will get an error if the file is already closed. I want to avoid looping and the error.
Is the anything like a "Close All" function?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- ? On Open / Close Files In VB
- How To Close All Open Files...
- Close Files That Are Not Open
- Open And Close Other .exe Files
- Close Windows Open Files Thru VB
- Open, Close & Save 'exe' Files
- ? On Open/close Files In VB (Resolved)
- How To Close All Open Files From The Path Specified?
- Open Files, Close Files
- Shell - It Wont Close - Moans About Open Files
- Should I Have 100s Of Winsock Connections Open/close.. Or Keep Them Open (hard Q)?
- Open An Excel Worksheet, Close It, Perform Cleanup And Open It Again - Can't Do It
- Open A File, Close It, Open Next.
- Open A File, Close It, Open Next.
- Close Then Re-open App
- Open Close
- Open/close Cd-rom
- Close An Open Exe From A Different Exe
- How Do You Close An Open App?
- Open/Close Cd Rom
- Close And Open Again ...
- On Close Open App
- How To Open/close CD-ROM?
- Close Exe That's Open?
- If Open Then How To Close
- Close All IEs Open
- CD Open And Close
- Open/Close Program
- Open And Close Access
- Close Open Folder
- If Recordset Open, Close
- How To Close.. Open Program
- Open And Close With 1 Button :(
- Do Not Close App If FORMS Are Open
- Open And Wait To Close
- Open/Close, Write/Put...
- New - Close Open *DELETED*
- Help Me Close Open Programs
- How I Close All Form That Open Under Mdi?
- Open/close Cd Error...
- Open Exe File, On Close Do...
- Open, First, Next, Last , Prev, Close
- Keep Connection Or Close & Re-open?
- How Can I Check And Close Any Open Cn Or Rs
- Open And Close Txt File
- Close Program If There Are 2 Of Them Open.
- Close All Open VB Windows.
- Close, Set, OPEN.....connection...
- Close All Open IE Browsers From Within VB6
? On Open / Close Files In VB
Hi,
I have a text file (see below) that I only care for "Port x/xx" at the end of each line. This is the output of a Cisco switch from issuing the "show logging buffer 1023" command and the output is being captured to a text file.
What is the best way to remove all the duplicated "Port x/xx" on each line?
Based on my limited VB experience, I can only think of opening 2 files within VB. 1) being input and the other being output. Read the text file one line at a time and using a string command to keep only "Port x/xx" and write that info into a second file. In the end, I will have the second file that contains all the "Port x/xx" with no similar entries.
I notice using open/close files in VB is time consuming imagine there are 25 of such logs I have to go through. Are there different or quicker methods to get this done?
Thanks in Advance,
Log file starts here
==============
2004 Mar 09 09:34:05 %PAGP-5-PORTTOSTP:Port 3/14 joined bridge port 3/14
2004 Mar 09 09:34:25 %PAGP-5-PORTFROMSTP:Port 3/14 left bridge port 3/14
2004 Mar 09 09:34:33 %PAGP-5-PORTTOSTP:Port 3/14 joined bridge port 3/14
2004 Mar 09 10:02:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 10:03:46 %PAGP-5-PORTTOSTP:Port 2/28 joined bridge port 2/28
2004 Mar 09 10:32:46 %PAGP-5-PORTFROMSTP:Port 3/22 left bridge port 3/22
2004 Mar 09 10:32:54 %PAGP-5-PORTTOSTP:Port 3/22 joined bridge port 3/22
2004 Mar 09 10:34:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 10:37:50 %PAGP-5-PORTFROMSTP:Port 3/22 left bridge port 3/22
2004 Mar 09 10:37:59 %PAGP-5-PORTTOSTP:Port 3/22 joined bridge port 3/22
2004 Mar 09 10:42:10 %PAGP-5-PORTFROMSTP:Port 3/22 left bridge port 3/22
2004 Mar 09 10:42:18 %PAGP-5-PORTTOSTP:Port 3/22 joined bridge port 3/22
2004 Mar 09 11:06:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 11:23:33 %PAGP-5-PORTFROMSTP:Port 3/32 left bridge port 3/32
2004 Mar 09 11:24:04 %PAGP-5-PORTTOSTP:Port 3/32 joined bridge port 3/32
2004 Mar 09 11:24:44 %PAGP-5-PORTFROMSTP:Port 3/32 left bridge port 3/32
2004 Mar 09 11:25:18 %PAGP-5-PORTTOSTP:Port 3/32 joined bridge port 3/32
2004 Mar 09 11:26:28 %PAGP-5-PORTFROMSTP:Port 3/32 left bridge port 3/32
2004 Mar 09 11:26:34 %PAGP-5-PORTTOSTP:Port 3/32 joined bridge port 3/32
2004 Mar 09 11:38:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 12:10:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 12:42:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
Log file ends here
==============
How To Close All Open Files...
I open a file to write to it, but sometimes it will come back and say file already open. How can I make sure that all the files in my application are closed?
Close Files That Are Not Open
I am downloading file from the internet with freefile
FileOne = Freefile
FileTwo = Freefile
FileThree = FreeFile
After each file is downloaded then
Close #FileOne, Close #FileTwo, Close #FileThree
The connection could be interupted at any point or the form closed
Is this wrong?
on error resume next
Close #fileOne
close #filetwo
close #file Three
On error goto error handler
I realize i could write a module boolean for each file and set it to true when they get succeffuly opened and then downloaded and then selectly close them.
Sure be a lot easier to just close them all even if they are not open.
Bad idea?
Open And Close Other .exe Files
I want to write my own online update system. I have several reasons for that as most of my updates are data related. I want to be able to load a different .exe file from my program and then shut down my program to replace it's .exe file if needed.
Is it possible to open another .exe file from VB and also to close any running instance of a program from VB...
Something like this
From myProgram
Command1_Click
Open myUpdates.exe
From myUpdates.exe
Command_Click
Close myProgram.exe (All Open Instances)
Can anyone help please !!!
Thanks
Chris
Close Windows Open Files Thru VB
I want to write a VB 6 app to close files opened by another application. These files are text files and csv's that sporadically get left open after the program finishes. I have another application that manipulates these files but on occasion cannot because I get a File Already Open error.
I have to go onto the file server itself, open computer management, Shared Folders, Open Files then find the open file(s) and manually close it/them.
I was hoping that someone knew of an API or other method of doing this through VB.
Open, Close & Save 'exe' Files
Hello all,
Is it possible to write code that will open an exe file, close an exe file and save an exe file. RobDog888 offered the following code to another member, which I'm yet to try, which might just need some additional lines to cover the close & save parts?
Code:
1.Option Explicit
2.
3.Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
4. ByVal hwnd As Long, _
5. ByVal lpOperation As String, _
6. ByVal lpFile As String, _
7. ByVal lpParameters As String, _
8. ByVal lpDirectory As String, _
9. ByVal nShowCmd As Long) As Long
10.
11.Private Const SW_HIDE As Long = 0
12.Private Const SW_SHOWNORMAL As Long = 1
13.Private Const SW_SHOWMAXIMIZED As Long = 3
14.Private Const SW_SHOWMINIMIZED As Long = 2
15.
16.Private Sub Command1_Click()
17. ShellExecute Me.hwnd, "Open", "C:SomeFolderSomeFile.exe", vbNullString, "C:", SW_SHOWNORMAL
18.End Sub
Thank You
Tarablue
? On Open/close Files In VB (Resolved)
Hi,
I have a text file (see below) that I only care for "Port x/xx" at the end of each line. This is the output of a Cisco switch from issuing the "show logging buffer 1023" command and the output is being captured to a text file.
What is the best way to remove all the duplicated "Port x/xx" on each line?
Based on my limited VB experience, I can only think of opening 2 files within VB. 1) being input and the other being output. Read the text file one line at a time and using a string command to keep only "Port x/xx" and write that info into a second file. In the end, I will have the second file that contains all the "Port x/xx" with no similar entries.
I notice using open/close files in VB is time consuming imagine there are 25 of such logs I have to go through. Are there different or quicker methods to get this done?
Thanks in Advance,
Log file starts here
==============
2004 Mar 09 09:34:05 %PAGP-5-PORTTOSTP:Port 3/14 joined bridge port 3/14
2004 Mar 09 09:34:25 %PAGP-5-PORTFROMSTP:Port 3/14 left bridge port 3/14
2004 Mar 09 09:34:33 %PAGP-5-PORTTOSTP:Port 3/14 joined bridge port 3/14
2004 Mar 09 10:02:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 10:03:46 %PAGP-5-PORTTOSTP:Port 2/28 joined bridge port 2/28
2004 Mar 09 10:32:46 %PAGP-5-PORTFROMSTP:Port 3/22 left bridge port 3/22
2004 Mar 09 10:32:54 %PAGP-5-PORTTOSTP:Port 3/22 joined bridge port 3/22
2004 Mar 09 10:34:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 10:37:50 %PAGP-5-PORTFROMSTP:Port 3/22 left bridge port 3/22
2004 Mar 09 10:37:59 %PAGP-5-PORTTOSTP:Port 3/22 joined bridge port 3/22
2004 Mar 09 10:42:10 %PAGP-5-PORTFROMSTP:Port 3/22 left bridge port 3/22
2004 Mar 09 10:42:18 %PAGP-5-PORTTOSTP:Port 3/22 joined bridge port 3/22
2004 Mar 09 11:06:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 11:23:33 %PAGP-5-PORTFROMSTP:Port 3/32 left bridge port 3/32
2004 Mar 09 11:24:04 %PAGP-5-PORTTOSTP:Port 3/32 joined bridge port 3/32
2004 Mar 09 11:24:44 %PAGP-5-PORTFROMSTP:Port 3/32 left bridge port 3/32
2004 Mar 09 11:25:18 %PAGP-5-PORTTOSTP:Port 3/32 joined bridge port 3/32
2004 Mar 09 11:26:28 %PAGP-5-PORTFROMSTP:Port 3/32 left bridge port 3/32
2004 Mar 09 11:26:34 %PAGP-5-PORTTOSTP:Port 3/32 joined bridge port 3/32
2004 Mar 09 11:38:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 12:10:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
2004 Mar 09 12:42:38 %CDP-4-DUPLEXMISMATCH:Full/half duplex mismatch detected on port 3/11
Log file ends here
==============
How To Close All Open Files From The Path Specified?
I need to have a code which closes all of the files open in the path specified, for example: if the path is: "C:TEMP" and contains 3 files, of which 2 are open, the code must check which files are open of these 3 and close them.
Waiting for a hint!
Open Files, Close Files
In the cmdProcess Procedure I have the Close_Files so I can force the Generate_Size_Report to be written to the txt.file. But when i put the Open_files in the Procedure it clears the txt.file so How can I make the files be written to the txt.file while the program is still running. And i need to keep the file as Output.
Private Sub cmdProcess_Click()
Generate_Size_Report
Close_Files 'I think The Problem is Right Here
Open_Files 'Or right here
End Sub
Private Sub Generate_Size_Report()
Print #2, "Extra Large: ", ELarge_Accum
Print #2, "Large: ", Large_Accum
Print #2, "Medium: ", Medium_Accum
Print #2, "Small: ", Small_Accum
End Sub
Private Sub Close_Files()
Close #1
Close #2
End Sub
Private Sub Open_Files()
Open "a:jimspizza.txt" For Append As #1
Open "a:jimsSizeReport.txt" For Output As #2
End Sub
Shell - It Wont Close - Moans About Open Files
This is driving me nuts. It wont close the share it opens because it says there are still open files, but I have closed any files that I open in the code.
I'm throwing this open to you folk to help me come up with things to look at. I use 'net use' to open and close the shares. I have included my main sub below which is going through each directory that I pass to it and checking for recent files. Some of the paths might be shares, so if thats the case, it opens up the share, checks the files and then closes the share (except it doesn't!)
This sub below is the only one I've changed around since it started to not work. There are other subs which lead off this one, if anyone feels the need to see those, then please let me know.
I hope someone can see something wrong (aparent from the fact that its a large sub) or suggest something.
Thanks.
Code:
Sub Detect_Recent_Files()
Dim Counter As Integer
Dim fso As FileSystemObject
Dim File As File
Dim Folder As Folder
Dim FileName
Dim FileDate
Dim StartDate As String
Dim FileNameCounter As Integer ' Used to increment filename array for each log file location
Dim Veritas_LogFiles_Count As Integer
Dim NTBackup_LogFiles_Count As Integer
Dim Robocopy_LogFiles_Count As Integer
' Local copies to redim arrays
Veritas_LogFiles_Count = 0
NTBackup_LogFiles_Count = 0
Robocopy_LogFiles_Count = 0
Counter = 0
' Global copies to increment through logfile arrays
LogFiles_Count = 0
RobocopyLogFiles_Count = 0
NTBackupLogFiles_Count = 0
StartDate = (Date - 1) & " " & Time()
For Counter = 0 To LogCounts - 1
' If the logs are on a remote share, we need to open that share and point this sub at that location
If LogInformation(Counter).LogPhysicalLocation = "SHARE" Then
' Check if there is already a share
If Dir("M:", vbDirectory) <> "" Then
' Share which was created last time in loop has failed to close
' Indicate and report error
LogInformation(Counter).Log_Checked = False
LogInformation(Counter).Log_Checked_Reason = "Previous Log Set Share failed to be closed. Unable to report on this log set."
' Skip to end of loop
GoTo failedshare
End If
' Create a share to server where log files are
Call Create_Share(LogInformation(Counter).LogLocation)
' Indicate the drive letter that the share will be on to program, so it knows where to check for recent files
LogInformation(Counter).LogLocation = "m:"
' Check if share was created
If Dir("M:", vbDirectory) = "" Then
' Share drive hasn't been created
' Indicate and report error
LogInformation(Counter).Log_Checked = False
LogInformation(Counter).Log_Checked_Reason = "Failed to Create Share"
' Skip to end of loop
GoTo failedshare
End If
End If
' Reset FileNameCounter
LogInformation(Counter).LogFileNames_Counter = 0
Set fso = CreateObject("Scripting.FileSystemObject")
For Each File In fso.GetFolder(LogInformation(Counter).LogLocation).Files
' Indicate that log set was checked
LogInformation(Counter).Log_Checked = True
If (File.DateLastModified > ((Date - 1) & " " & Time())) And (File.DateLastModified < (Now())) And (File.Type = "Text Document") Then
' Check that we have found a recent file that is a veritas backup file
If LogInformation(Counter).LogType = "VERITAS" Then
' If the file type is veritas, the filename it detects as recent must start with BEX
MyName = InStr(1, File.Name, "BEX", vbTextCompare)
If MyName = 0 Then
' This recent file is not a backup file!
GoTo skipthisfile
End If
End If
' Checks for file being a NTBackup file
' Checks for file being a Robocopy file
ReDim Preserve LogInformation(Counter).LogFileNames(LogInformation(Counter).LogFileNames_Counter)
LogInformation(Counter).LogFileNames(LogInformation(Counter).LogFileNames_Counter) = LogInformation(Counter).LogLocation & "" & File.Name
LogInformation(Counter).LogFileNames_Counter = LogInformation(Counter).LogFileNames_Counter + 1
' Prepare the logfile arrays so that they have the right number of elements ready when it comes to examing the files
If LogInformation(Counter).LogType = "VERITAS" Then
Veritas_LogFiles_Count = Veritas_LogFiles_Count + 1
ReDim Preserve LogFiles(Veritas_LogFiles_Count)
End If
If LogInformation(Counter).LogType = "NTBACKUP" Then
NTBackup_LogFiles_Count = NTBackup_LogFiles_Count + 1
ReDim Preserve NTBackupLogFiles(NTBackup_LogFiles_Count)
End If
If LogInformation(Counter).LogType = "ROBOCOPY" Then
Robocopy_LogFiles_Count = Robocopy_LogFiles_Count + 1
ReDim Preserve RobocopyLogFiles(Robocopy_LogFiles_Count)
End If
skipthisfile:
End If
Next
' Tidy up for next loop
Set fso = Nothing
Set File = Nothing
Set Folder = Nothing
' Having found a list of recent files for this particular log set we thenneed to examine them
Call Check_LogFiles(Counter)
If LogInformation(Counter).LogPhysicalLocation = "SHARE" Then
' If the files were on a remote share, disconnect that share
Call Delete_Share
End If
failedshare:
Next
' TEST BITS
For Counter = 0 To LogCounts - 1
If (LogInformation(Counter).LogFileNames_Counter) = 0 Then
' Do nothing
Else
For Counter2 = LBound(LogInformation(Counter).LogFileNames) To UBound(LogInformation(Counter).LogFileNames)
Debug.Print LogInformation(Counter).LogFileNames(Counter2)
Next
End If
Next
End Sub
Should I Have 100s Of Winsock Connections Open/close.. Or Keep Them Open (hard Q)?
Hello
Ive got a server to which many clients connect to.
They each are given a few tasks to complete - which may or may not take a long time to finish, and after each task is done they send back the result.
This has caused massive amounts of problems for me. Right now I keep the connections open all the time. My server listens on one particular winsock control on a particular port to which all clients connect. It then accepts the connection request thru a second array of winsocks, so each client is connected to the server via the array via one connection.
There is generally no problem sending out the tasks thru that single connection/client - but receiving is a problem. The client may need to send back a few hundred kb at a time but since it was completing several tasks at once - it is not always received correctly. My guess is because taskA is sending data thru the connection at the same time as taskB - and the data isnt received right (each task sends its data via a <start> and an <end> string so I know where the start/end of data is and when transmission is over). Its important to note that the tasks are multithreaded (via a 3rd party control)
The data is sent in one line per task. winsock.SendData theResult. But many tasks can complete at around the same time. I thought that VB would wait until the data was completely sent (for one lines code) before moving on... but I dont think this is happening. I even tried adding a DoEvents but to no avail - I still cant receive the data properly. Maybe winsock is 'skipping over' some data - I dont know. (Kinda like when if you 'break' the application winsock does not get incoming data and when you resume it still wont pick it up)
So Ive got 2 options..
1) Somehow figure out how to receive data properly when multiple tasks finish on a client at around the same time and they send data at the same time - basically making the program send the data of a task and not continue until the data has been sent, then send another tasks data.
2) Use many connections. Basically the max # of tasks running at once will be about 10. So the idea is to have another winsock array of 10, each dedicated to one task, and when a task is completed - connect thru the winsock array, send the data, and when the server receives it - it disconnects.
3) A mixture of 1 and 2 - have the 10 winsocks connect to the server and be open at the same time, then I can just send data and receive via a specific winsock array control and there is no problem distinguishing taskA from taskB from taskC on a client, or client from client.
But honestly.. I dont know if its 'bad' to have lots of connections open and close all the time. And I dont know if its 'bad' to have thousands of connections open at the same time either..
What do you guys think?
Open A File, Close It, Open Next.
I've got my searching code going now, but I'm looking for a way to tell the program to load each file in a directory, one at a time, search, close it, move on to the next. And I have no clue how to do that. Any ideas?
Thanks in advance.
-Jer
Open A File, Close It, Open Next.
I've got my searching code going now, but I'm looking for a way to tell the program to load each file in a directory, one at a time, search, close it, move on to the next. And I have no clue how to do that. Any ideas?
Thanks in advance.
-Jer
Close Then Re-open App
I am trying to find a solution that will close and then re-open a vb app if it is idle for more than 30 mins
The reason is because I was told that vb apps don't release memory so I want to sort of "auto release or refresh the memory" any ideas?
Open Close
When i user this code to open a file:
Code:
Open FName For Input As #1
Input #1, Data
Close #1
Edit1.Text = Data
It opens the first line or up to the next ','. What is the correct method for opening a file?
Close An Open Exe From A Different Exe
How do I close an open Exe from another Exe?
Once I close this Exe I want to delete this Exe from another Exe, Please let me know as to how can I do this?
How Do You Close An Open App?
If I want to close something with code, and I know its running, like ms word or something, how would I go about doing that?
On Close Open App
how do i do something like on close of application or on error open "shell code here"
How To Open/close CD-ROM?
Hi
Does anybody know how to open/close CD-ROM?
I'm really a amatuer so..............
Thnx!
Netherlands
Close Exe That's Open?
I need to close an Exe that's already running. I know the window title, and the name of the exe. Thanks for any help!
If Open Then How To Close
In my code I'm creating a log file of some of the events I'm trying to track. Every now and then when the program checks to see if the log file exists it flags that its open then immediately exist the sub. Meanwhile it missed an entry. The error I receive tells me that the log file is open when checking for the existance.
What am I missing:
Code:
'declaration
Public strChecker As String
'create migration logs
Public Sub LogName()
Dim strLog As String
Dim Location As String
Location = App.Path & ""
strLog = Location & strLogName & ".log"
strChecker = strLog
FileExists
If intTest <> 0 Then
Open strLog For Append As #1
Else
Open strLog For Output As #1
End If
'the information for the log goes below
end sub
''if intTest=0, then there is no file to replace. Anything else means it exists.
Public Sub FileExists()
intTest = Not (Dir(strChecker) = "")
strChecker = ""
End Sub
If the log file was left open for some reason intTest returns a -1 indicating the fileexists, thats good, but when it returns to the if then above and tries to append the file it jumps out.
Is there a way to check to see if "c:crap.log" is open before appending then close it.
TIA,
Close All IEs Open
Anyone have a code to closes all instances of IE open,not just the active one?
Thanks
CD Open And Close
does anyone know how you can open and close the cd-rom drive with visual basic?
Open/Close Program
I'm trying to write a program that will be able to open a file, apply values from the file in an array, close that file. If I try to open another file and apply a different number of values to the same array (even if I redimension it first), I get a 'Subscript out of range' error.
I think the best way around this error is if I can simply restart the program.
Is there a way to run a separate vb program that will close the current program, and re-open it?
Open And Close Access
Sounds simple enough, but I'm not quite sure where to start. I used the tutorial for opening and closing Excel, but it looks like the commands are different and after a lot of searching, I still cannot find a code example of how to open and close Access from VB. If someone could share a code snippet, I'd really appreciate it!
Close Open Folder
I am using a shell command to open a folder. How can I close it afterwards?
If Recordset Open, Close
VBA for Access 2002:
What's the best way to do this? The two examples below produce Object Variable ir Wirh Block not set, or Runtime 91 errors
' if recordset is open, close
If rs.State = 1 Then rs.Close
If rs.State And adStateOpen Then rs.Close
Thanks in advance for the help...
How To Close.. Open Program
I use the shell program to open my internet explorer.... Now I want to close it by clicking a button on my program... How can I do this.. does any one could give me a code.. thanks
Open And Close With 1 Button :(
hello ppl, i'm new to vb and i have a problem...
i have 2 forms.
the 1st with a button called 'show wage details'
the 2nd form which has no buttons (no buttons needed).
now my problem...
i want to use the 'show wage details' button, so th@ when its pressed, the 2nd form will show, the caption will change from 'show .....' to 'hide ......' and then if th@ button is now pressed after the caption change, it will hide the 2nd form and re-display 'show .....' again.
i can change the caption and show the 2nd form, but i cant get my button 2 function as a hide form or get the caption to change.
plz if ne1 can help me, i'd be very greatful
thanx for the help
Do Not Close App If FORMS Are Open
Is there a way of stopping an application from closing if other forms are still loaded. So before they can close the app they must close the other forms.
I know you can do if form.visible then cancel = true
but is there a general thing where it knows whether other forms are visible or not.
Thanks
Open And Wait To Close
Hi, How I can open a file using the Filename, and wait to be closed, it means, stops the code execution.
Thanks !!
Open/Close, Write/Put...
I have a server/client program that I have been working on. The client opens up and ftp's its ip to a secure site. The server starts up and downloads all the ip's from the ftp site.
The purpose of this is to be able to help friends with their pc's AND as a way to kind of set up a server for a game I have been working on for me and a few friends. This would allow for easier connections and help me avoid having to send ip's over email before each session.
It then pings and lists all available ip's. I request a connection and I am accepted. I request a directory listing and receive it.
I need to be able to download files from the other computer. I have been succesful with .txt files but NOT with .jpg and other formats. Here is what I was using.
The client does this:
Dim i As Integer
Dim sTxt As String
i = FreeFile
Open strFileToSend For Binary As #i
Do Until EOF(i)
DoEvents
Line Input #i, sTxt
buff = buff & sTxt & vbCrLf
Loop
Close #i
wsClient.SendData "FILE" & strFileToSend & "," & buff
The server does this:
Open sFile For Binary As #1
Put #1, , strFileData
Close #1
I have never worked with winsock much and admit I don't really understand what opening as binary does.... is there anything obvious to you that I am not seeing.
Basically I need to be able to request and receive files from other pc. Thanks for ANY help you can offer. This is currently the only thing holding my project up. Thanks.
Help Me Close Open Programs
In my program i want to "see" the path of all programs and close certain one
s, depending on the users settings. How do i find the paths of OPEN programs
and then terminate them?
Open/close Cd Error...
i have this code that should open/close the cd-rom when i click on a button but it gives an error wich i dont understand. What is wrong with it?
This is the code i use.
Code:
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Dim lngReturn As Long
Dim strReturn As Long
'This one opens the cd door:
lngReturn = mciSendString("set CDAudio door open", strReturn, 127, 0)
'and this one closes the cd door:
lngReturn = mciSendString("set CDAudio door closed", strReturn, 127, 0)
Open Exe File, On Close Do...
A bit cryptic...
What i want is, to start a exe file (with shell command). If i close this same exe file ,the program (code) witch has started the exe must do something. How can i do this???
Carlito
Open, First, Next, Last , Prev, Close
(new at databases) I'm at the onset of trying to create a simple example of a bringing up one-at-a-time (Access 2000) table databases (topics: one db on colleges, one db on airports, one db on students) and displaying the contents in individual textboxes ... not using the ADO or Data control as the goal is to build this without using a control and manually code all buttons and making the fields show up in specific textboxes.
I have created an interface that has:
- one input textbox to enter the desired database name - user has a choice of three.
- one command button to open the entered database name.
- various command buttons for moving to First, Next, Last, Prev records and possibly adding, deleting, searching records.
- various textboxes for every individual item to display based upon which database was entered ... such as college or airport name, code, address, city, state, zip, phone, website, email address, etc., SSN, student name, student address, etc.
I know the db has to be opened, recordsets defined, txtboxes defined, amongst other events that I'm unsure of ... I'm looking to see if there is an example on something like this? Then I could see the pieces needed and how it's put together. Just something similar, even if it only shows one database, that would give me an idea how to do this.
I can show what I've done so far, no way is it close, just has snippets of code for now, definitely not complete, but it's where I am at ...
Can anyone help? simple examples?
Attached what I have built so far.
Keep Connection Or Close & Re-open?
I have a VB app that allows up to 10 clients to access an Access 97 db (typically about 50 meg in size) on an NT server. Each client opens one connection to the database and the connection remains open as long as the app is running. The app typically needs to create and close many recordsets.
Anyone have an opinion as to whether this is a poor practice? If so, what problems might it cause. Also, what effects might I see if I continually open and close connections as they are needed?
(using DAO now but am currently upgrading to ADO)
How Can I Check And Close Any Open Cn Or Rs
Hello
How can I check is there any Open Connection or Recordset to database from any where taht I need?
And how can I close any open Database any time I need?
VB6 & Access & ADO
Thanks
Open And Close Txt File
hi im trying to align the name and the email address can someone help me out?
Private Sub cmdcontact_Click()
'Save Contact
Open "contact.txt" For Append As #1
Printer.Print "txtname.Text", "txtemail.Text"
MsgBox ("Contact Saved")
End Sub
it ends up coming out like this in the text file
jim mack jmack@gmail.com
Albert Sanchez ASanchez@gmail.com
Chris Jones Cjones@mail.com
Close Program If There Are 2 Of Them Open.
Well. I am designing a new program and it's a trial run with only one allowed per machine. so you can't have like 30 open.
do you know how to make it so it closes if there are two projects open
Close All Open VB Windows.
Is there a way to close all the open code and form windows in VB?
It's just that when I stop the program I have to wait for all the open windows to refresh before I can do anything.
It's getting worse as my program gets bigger.
Close, Set, OPEN.....connection...
head fired!!!!!!!!
When i click on button4 (this button UPGRADE record in mdb) have this message:
"opearation not possible if object is open....." error 3705
WHY!!!!!!
|