Computer Science Canada

Connecting to a server/database.

Author:  Mint [ Wed Jun 16, 2004 8:35 pm ]
Post subject:  Connecting to a server/database.

I am sort of new to VB blah blah blah... I was just woundering how I could get a a program client to connect to a server running server software (that would be custom made).

Basicaly I was woundering if anyone could inform me on making server and client software and to make the client side connect to the server with a specific IP and the like. I need the computers to be able to communicate with the server and write to and create a specific text files. (Each user that signs up gets a text file to store stats or whatnot, I know how to make the login and to create the text file on my machine but I have no idea how I can make the computer connect to one running the software.)

-How complicated is it?
-How can I do it?

Thanks.

Your's truly,

~Captain Me

Author:  Mint [ Wed Jun 16, 2004 9:34 pm ]
Post subject:  Moo.

Oh, and any links to tuts that could help would be appreciated. That and a basic outline of what I would need if possible.

Thanks.

Author:  Mint [ Thu Jun 17, 2004 11:37 am ]
Post subject:  Wow.

Wow, I can't can't believe that I didn't remember that other post ("Network Program" by w00rm). I will most likely post more in this topic soon though. But still if anyone has anything at all that would help please post. Thanks.

Author:  Tony [ Thu Jun 17, 2004 2:33 pm ]
Post subject: 

sockets come to mind... but I honestly haven't done any networking in VB Confused

Author:  Mint [ Thu Jun 17, 2004 4:27 pm ]
Post subject: 

tony wrote:
sockets come to mind... but I honestly haven't done any networking in VB Confused


Thanks for the feedback, it's really too bad there aren't many people who frequent the VB forums.

Author:  Tony [ Thu Jun 17, 2004 10:44 pm ]
Post subject: 

yeah, it really is a shame...

I suspect the reason being is that so very few schools cover VB. other then Turing, its mostly C++ or Java Confused

Author:  Mint [ Fri Jun 18, 2004 11:37 am ]
Post subject: 

tony wrote:
yeah, it really is a shame...

I suspect the reason being is that so very few schools cover VB. other then Turing, its mostly C++ or Java Confused


Yeah, that and most people don't bother to try to learn basic, casting it aside as a useless language. Awell more for the rest of us ...or something.

Author:  Brightguy [ Fri Jun 18, 2004 9:38 pm ]
Post subject:  Re: Connecting to a server/database.

At first I thought you were talking about a FTP server... must read properly from now on...

Tony's right - if you use WinSock it shouldn't be a problem. Have the server application create the text file in Winsock's DataArrival event.

To connect to another computer, use WinSock's Connect method. First you must know the server's IP address (RemoteHost property) and the "listening" port (RemotePort property).

For the server, set the LocalPort property to the "listening" port and then use the Listen method.

Use the SendData method to send data, and the GetData method to retrieve the data (there is a DataArrival event).

Author:  Mint [ Fri Jun 18, 2004 10:14 pm ]
Post subject: 

Do you have to pay for Winsock, is it free? I need to know so I can 'buy' it.

Author:  Brightguy [ Fri Jun 18, 2004 11:37 pm ]
Post subject:  Re: Connecting to a server/database.

I think the Winsock control comes with VB, at least in some versions. So check if you have it installed... On the menu, go to Project > Components... and then check Microsoft Winsock Control.

If you don't have it installed search for MSWINSCK.OCX and then place that file in your C:\WINDOWS\SYSTEM directory. Some applications that require Winsock automatically install/register it, so I guess it can be distributed...

Author:  Mint [ Fri Jun 25, 2004 1:43 pm ]
Post subject:  Re: Connecting to a server/database.

Brightguy wrote:
I think the Winsock control comes with VB, at least in some versions. So check if you have it installed... On the menu, go to Project > Components... and then check Microsoft Winsock Control.

If you don't have it installed search for MSWINSCK.OCX and then place that file in your C:\WINDOWS\SYSTEM directory. Some applications that require Winsock automatically install/register it, so I guess it can be distributed...


Thanks for the help although I haven't gotten around to trying it yet. I did however find the file and put it in my \system directory.

Author:  Paul [ Sat Jun 26, 2004 9:04 pm ]
Post subject: 

tony wrote:
yeah, it really is a shame...

I suspect the reason being is that so very few schools cover VB. other then Turing, its mostly C++ or Java Confused

Well u can expect me to be here next year, grade 11 compsci, contains VB, but first 3 months of turing, since grade 10 compsci isn't a pre-requisite for grade 11.

Author:  wtd [ Tue Jul 06, 2004 5:00 pm ]
Post subject: 

Mint wrote:
tony wrote:
yeah, it really is a shame...

I suspect the reason being is that so very few schools cover VB. other then Turing, its mostly C++ or Java Confused


Yeah, that and most people don't bother to try to learn basic, casting it aside as a useless language.


It pretty much is, now.

VB.NET is essentially C# with a more verbose syntax that looks a bit like VB6, but is completely different in reality. Microsoft is clearly pushing C# first and foremost, and VB.NET is there to make VB programmers feel like MS cares about them.

Author:  Dan [ Tue Jul 06, 2004 9:27 pm ]
Post subject: 

Mint wrote:
tony wrote:
yeah, it really is a shame...

I suspect the reason being is that so very few schools cover VB. other then Turing, its mostly C++ or Java Confused


Yeah, that and most people don't bother to try to learn basic, casting it aside as a useless language. Awell more for the rest of us ...or something.


You can keep it all for your self, even turing is more protable then VB. (there is truing for mac and some rummers of verson for linux).

Author:  Tony [ Tue Jul 06, 2004 9:29 pm ]
Post subject: 

yes dan, it's really a shame that we can't run a VB database management app on your toaster... Laughing

Author:  Dan [ Tue Jul 06, 2004 9:32 pm ]
Post subject: 

tony wrote:
yes dan, it's really a shame that we can't run a VB database management app on your toaster... Laughing


it is, i need to know the info of my toasters stats and it is just a pain that my VB toserer database app can not run on it.

But u have to rember there are other OSs then windows, some much better ones. and affter longhorn comse out i am beting alot of poleop will be chaging to linux or other non M$ OSs.

Besides why whould u code in VB when u could uses java or C++?

Author:  Tony [ Tue Jul 06, 2004 9:38 pm ]
Post subject: 

Hacker Dan wrote:

Besides why whould u code in VB


well say you want to quickly throw together an app that integrates IE 5.5 functionality and runs exclusivly in windows XP with 2nd service pack installed...

then...

ah screw it, you shouldn't be using IE Laughing

Author:  Random [ Fri Nov 05, 2004 10:15 pm ]
Post subject:  Usefullness of VB and an idea

I did it backwards... I learnt VB myself in gr 8 and then learned turing in gr 10. I suppose i shouldnt be arguing wit an admin about the usefulness of VB but... Its the fact that you can drag and drop controls and make such a userfriendly program in such a short time. Although, I should learn C because VB is SLOW. Using C DLLs is the way to go.

Anyway, the reason I was posting was that if youre interested in learning how to use Winsock go to http://www.planetsourcecode.com and search for a winsock chat. You'll find many good examples of server/client chats that use winsock to transfer data from one computer to another.

Hope that helped

Author:  Brightguy [ Fri Nov 05, 2004 11:24 pm ]
Post subject:  Re: Usefullness of VB and an idea

Yeah, VB is useful for creating quick projects designed to run under Windows.


: