PDA

Click to See Complete Forum and Search --> : UPLOADING DATA?


vbdeveloper
Nov 27th, 2000, 09:01 AM
Dear Reader,
I would like to know that is there any way i can upload data from my Visual Basic application directly to my database on the website.

This should happen such that the data entry in the vb form is done on my machine while i am not connected to the net and when i submit my vb form (i.e.) click on the command button named submit then

1) Connection is established to the net
2) Data is uploaded.



Any code or reference material would be heartly accepted and be of great help.

Thank you for taking time out to read.

Nov 27th, 2000, 11:04 AM
Oh...let me count the ways... 1-1000, 2-1000, 3-1000...Mumph!

Sorry...that was a very bad attempt at a very bad quote from a very bad film.

Right...there are numerous ways you could do it...

If you have an Access type database file sat on a server somewhere, you could:

1) Use the Internet Transfer Control to download the database file, use DAO/ADO to add the record then reupload the database file. This method is seriously not recommended tho...first off if you use an old version of the Internet Transfer Control then there is a bug that prevents some files from being downloaded fully and you'd end up with one very corrupt database. Also, if someone else updated the database in between you downloading then re-uploading it then their changes would be lost.

NEXT!...

2) You could write some cgi script/program (like an asp page maybe) on the server which communicated with your program. What I mean is... you could have an asp script on the server which accepts values in its query string, then it puts these values in the database. Your program could use the Internet Transfer Control to request the script specifing your user's information in the query string. This is fairly fiddly to do, but if you'e using an Access databse then it's the best way I can think of.

Ok...now suppose you're using a database that you can connect to using TCP/IP or some such thing...something like a SQL Server database:

You can use ADO (maybe DAO too...I'm not sure) to connect to the SQL server and alter the database just like you would if it were on your local machine. This is by far the best way I know of and the method I use myself. I can post you an example program if you want.