Solved

VB and Networking

Posted on 1998-10-13
16
267 Views
Last Modified: 2013-11-15
Can VB handles networking ? eg. Using VB to write a program to display the info from a database thru TCPIP call to a database.
Please state some examples to justify , thanks ~
0
Comment
Question by:SkyWolf
  • 9
  • 6
16 Comments
 
LVL 14

Expert Comment

by:waty
ID: 1439586
What do you mean by VB handles networking? Could you explain...

Sure VB can communicate with other computer over a lan, using all the possible protocols (this is handled by Windows, not by VB).

You can access a database on lan....
0
 

Author Comment

by:SkyWolf
ID: 1439587
I mean , Is using VB to implement a console system that requires networking feasible  ?
0
 
LVL 9

Accepted Solution

by:
david_levine earned 120 total points
ID: 1439588
VB is a windows development language. You can do many things in it - access databases (Client / Server), communicate through TCP/IP for things like initiating FTP's, and even embed browser controls inside VB and create your own browser.

As for databases, VB can communicate directly with many databases such as Sybase, Oracle and MS SQL. VB actually communicates to the client software for the particular database which in turn communicates to the server. VB can also communicate to anything that provides an ODBC interface.

Besides your example in the question, post a comment on anything particular you would like to do and I'll let you know if it's possible
0
 

Author Comment

by:SkyWolf
ID: 1439589
1st of all I would like to know what whether I can exe a program within a VB program
2) retrieving details from a log file ( I think it can be done but to make sure)
3) print the details to a report using Crystal Report
4) displaying a red, amber, green icons to indicate the level , like the traffic light thing
5) checking status of another application, status/activity of a port , status/activity of a line(telephony)


0
 
LVL 9

Expert Comment

by:david_levine
ID: 1439590
1) If in your list #1 is can you create an EXE in VB, yes - but it requires a VB runtime DLL.

2) Yes you can read a flat file. The log file has to be accessible to the machine running VB. You can ftp it to the local machine, or access it via a network drive

3) Yes, you can create reports in Crystal from within VB

4) You can certainly create a status within your application, that based on a value displays a different color light (bitmap or icon).

5) A) I'm not sure what you mean by checking the status of another applciation.

5) B) You can write a ping program in VB to ping a port.

5) C) Status of a line depends on whether you have access to the line and the device the line is connected to.
0
 

Author Comment

by:SkyWolf
ID: 1439591
david_levine,
1) I meant can I execute another program within my VB program ( lets say my VB program is already in a EXE mode)
5A) *LOL* I am also not too sure I know what's to be done. This qs relates to qs 1) so i would like to know whether VB program check the status (like when u press Crt-Alt-Del they will show you the process not responding...)
0
 
LVL 9

Expert Comment

by:david_levine
ID: 1439592
You can launch other programs from within VB... by that I mean if you wanted to launch IE or Word, you just use the RUN command inside of VB specifying the executable you want to launch.

Within VB you can determine if another program is running within Windows. There are standard Windows API calls to see what is currently running. And if VB doesn't have it built-in you can always call the Windows API. If you want, you can even create your own taskman.exe (try running that from Win95).
0
 

Author Comment

by:SkyWolf
ID: 1439593
for 5A) can i check a port's status from a remote console ? i think it's workable right ? can  you confirm with me ? I mean running some exe file to check whether the prot is down ..
another qs , I can check whether the server is down or lost connection from VB porgam right  ?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:SkyWolf
ID: 1439594
Another thing , can i exe DLL written in C++  within the VB application ?? do i need converters or something ?
0
 

Author Comment

by:SkyWolf
ID: 1439595
One more thing,I realise I have to handle messaging , is VB capable of handling messaging ? any ideas where to look into for messaging codes ? what sort of information i need to know in order to program my application so that I can use VB to handle messaging , if VB is capable of so ?
0
 
LVL 9

Expert Comment

by:david_levine
ID: 1439596
Whew... lots of questions...

5A) You should be able to check a ports status but you will have to do your own winsock API calls since that functionality isn't in VB. You might be able to find an example someplace or at least a good starting point.

DLL's: You can use / call into any standard Windows DLL's. The only thing you need to be aware of is that VB won't support a CallBack function.

Messaging: I'm not sure what you mean. Windows itself if all based on messaging and that's how events get triggered. Can you be a little more specific.
0
 

Author Comment

by:SkyWolf
ID: 1439597
*LOL* I'll try to be more specific with my limited knowledge
Ok, whats winsock API calls ?
where can I find that example ?
0
 
LVL 9

Expert Comment

by:david_levine
ID: 1439598
Winsock API is getting down and dirty. Is this something you are going to do for fun or for business? Maybe you want to look at a commercial Winsock product vs the fairly simple control you get in VB or the detailed coding you might have to do if you need to call the winsock API. No offense, but based on some of your questions, I don't think your ready to get into API programming.
0
 

Author Comment

by:SkyWolf
ID: 1439599
*LOL* .. sorry to ask qs 1 by 1 but it just occure to me that how do I limit the file size of a log file ? I mean I want the log file to reset, overwrite the previous entry when reaching a certain size .
0
 
LVL 9

Expert Comment

by:david_levine
ID: 1439600
This question is out of the blue :)

How can you tell how big a file is? I think that's what you are asking...

You need to close the file
Determine the file size (not sure if VB has it built-in or you need to call a Windows API call)
Based on your "limit", you could rename the file to xyz.log.prev and open the new log file.

You could also make a log file that says is the last 200 log records and scroll the oldest one off when you add the new one. That would require determine the number of current log records, if its > 200 (my example) copy 2 thru 200 to a new file, add the new record and make it the old file.

Whew... any more questions?
0
 

Author Comment

by:SkyWolf
ID: 1439601
*LOL* you are right man ! I am not ready yet BUT it's definitely NOT for fun ... don't worry, I will make these answering seesions worth while *LOL*
1)so where do you suppose I will find those examples ? any sites you have come across?
2) I understand that by PING-ing, you can only check whether there is a connection to a particular ..... (process?what do you call it) right? so if this whatever is in a 'hanged' state, does it return a connection time out or a successfull PING ?

*sigh* my education sys here is in such a way that you are taught a wide area of things but not in depth ...


0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now